From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BC07AC433EF for ; Thu, 10 Mar 2022 18:46:09 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 21C9B83AD4; Thu, 10 Mar 2022 19:46:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="B/nQe1sD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4C38C83ACD; Thu, 10 Mar 2022 19:46:03 +0100 (CET) Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 37F0783AB6 for ; Thu, 10 Mar 2022 19:45:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=krjdev@gmail.com Received: by mail-wr1-x430.google.com with SMTP id r10so9434503wrp.3 for ; Thu, 10 Mar 2022 10:45:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:reply-to:mime-version :content-transfer-encoding; bh=8BU8fdVknPJLhDcIxCHMZCUVyMFEAb5xixKbESKiUIw=; b=B/nQe1sD6gn2WMqzXZMiQKulycezCWSliXJWw7o5emgs815oPHbJ9A/cIgBbuEtplV xSFcXdnLaJeq2cMHDVp3gux00iSdS4qZQeR0OJTCwFtGwT2IPPz8xATawomYgELjZQ5F hUd9bZrfTegObhXTdiclvxQZbkClxulB4vAcA2sypZznnNpTbiKB5ufQKzy1LEixNJ9+ skyxt7frsihlexr6zPQ3EgX4VMKy7ZJbrbYOM6gr7v/nBlsN7df2PYhBh7/iZqjoziIb zPVv+WuoRtF9T8nzjxRkfJV/iiCI3SWttWuffYSv+Neeyquw0O/5ghJaIyMv19WpHSWU xIJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :mime-version:content-transfer-encoding; bh=8BU8fdVknPJLhDcIxCHMZCUVyMFEAb5xixKbESKiUIw=; b=Kps7io3yzfO8m9K4iGAUxDNx5LaTA04EL4APoMSuH+8NB9kvQW2oUJp+3QTf4sbHBu eNVgK3RcjGf14Jg+OsAD9iJS3ju8E9hOfgvFm6LEhrHNDoyO6KiNyuZCpMgFY9jNwjbM lki9Qrnf5xjC2j3xrGxOZ9w6gUcHFV3S9tzeijzJNmY94nl9L9M56mFkjhMBbZ7tO8Fo 2z3Ln967KZgm3zrNazm37VuQHNyZMwaWhmH2y+bE3ba3TEs4k36oZ53wSDXP4ccXiEQ9 sHPoA/GzV0STe1CQgxv/gvS1ThRYVu1tuWo3u4dFNDtANd6QDgjBEJijI94g8nqRCLi5 jbOA== X-Gm-Message-State: AOAM5308FeXEfLV5ICQ8gsXpuhcaLxI+si3uS5PWwlKkLZ4gGroRdL3L h9aaX0w0N1WGA8QIGXoxd5ohJ0+6xfA= X-Google-Smtp-Source: ABdhPJxCGaioojHCIQ32B1Gb3IUwYTfpHaYFjPoCkBOvB71wwL1e5zYl8UJ/rTDGw2MzfsjI+txVYw== X-Received: by 2002:a5d:69d0:0:b0:1f1:fd05:e863 with SMTP id s16-20020a5d69d0000000b001f1fd05e863mr4649535wrw.223.1646937958458; Thu, 10 Mar 2022 10:45:58 -0800 (PST) Received: from matrix42.lan (212-197-176-189.adsl.highway.telekom.at. [212.197.176.189]) by smtp.gmail.com with ESMTPSA id e4-20020adffc44000000b001f1dba38a65sm4775742wrs.105.2022.03.10.10.45.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Mar 2022 10:45:58 -0800 (PST) From: Johannes Krottmayer To: u-boot@lists.denx.de, trini@konsulko.com Cc: Johannes Krottmayer Subject: [PATCH 0/2] CONFIG_EARLY_TIMER: Fix EAGAIN issue and use DM too Date: Thu, 10 Mar 2022 19:45:47 +0100 Message-Id: <20220310184549.1883-1-krjdev@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: krjdev@gnail.com Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Hi, I'm currently working on support for a STMicroelectronics board. I have written a DM driver which implements the timer_early_* functions. But noticed an issue when the configuration switch is set. common/board_f.c Here this leads in an EAGAIN issue, becaues the DM sub-system isn't running at this point. lib/time.c I modified the routines here, because it's also could fail. An addintionl feature is, that if CONFIG_EARLY_TIMER first it probes if, the DM timer is present, if not it uses the timer_early_* functions. Have compiled it in both configurations, and it works as accepted. Kind regards, Johannes Signed-off-by: Johannes Krottmayer Cc: Tom Rini --- Johannes Krottmayer (2): common: board_f.c: Fix EAGAIN issue when CONFIG_TIMER_EARLY is selected lib: time.c: Try also DM timer, when CONFIG_TIMER_EARLY is selected common/board_f.c | 6 ------ lib/time.c | 46 ++++++++++++++++++++++++++++++++-------------- 2 files changed, 32 insertions(+), 20 deletions(-) -- 2.34.1