From patchwork Sun Jan 15 21:15:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1726823 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=DAjlkCwL; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nw7JS5g9Zz23fk for ; Mon, 16 Jan 2023 08:16:56 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D214D85527; Sun, 15 Jan 2023 22:16:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="DAjlkCwL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C3A608551E; Sun, 15 Jan 2023 22:16:31 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (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 85776850D5 for ; Sun, 15 Jan 2023 22:16:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd33.google.com with SMTP id v65so8555459ioe.4 for ; Sun, 15 Jan 2023 13:16:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZHNkOOuL28i2YXkl9eWSzT+cAqH3dIvojnZv5cxJyTM=; b=DAjlkCwLHogg+qn/fFX7va61KEekmkCjhbRAhdSDRr94z/KcpfvuqA2XTxZJcVvgWA ud2uic3gB/XrgTWP6z/xG8l1QooY07lo6xsCaOMUptJtNV8u/S7Nd0NVoz8d2B9qjdEa Aih0ptiFuNJ/WLnPw20PZGBg0crX6fptj2VAM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZHNkOOuL28i2YXkl9eWSzT+cAqH3dIvojnZv5cxJyTM=; b=Ey6wvfC3qum8y+8enhCbCKIujwNtgSdanTS98eHGJ3U6pLm/lFerXdcVNHVcZBDyaj CbXnMjTAQOyE1kuCZwtSvwYcw0hDgxFD9Wj4zQ8nJf3qOM7Ym027qcZEHnCILmO3oJ1L 00yh2YUWdTx94MnSK9xWliqfWWVfD97XalcRsDa7V/JlQycrdCf1a2Zow7rAK4AkNJRs G5cBHGEUjDQEfgz+4hSgLMp+8vvt5BsiBzByq06fvVmcONW2IEPLDKF01F3oY9L2stqU aiat229tbD6ZiAekXI2kYipS5enjMEdNkedxwQk7JnFDzZhVLclKFQAuGlqA+w5Q0zo7 JKPg== X-Gm-Message-State: AFqh2kpCnO2M0zi52Xd0x8AS8Uw4Jf0Xy43up8nbKAG7nuyjeUdni8JS X4WD+Pk0zs5SztTsVNvfDikLMPCBeFkcySWBrEc= X-Google-Smtp-Source: AMrXdXv1NWH6Y3pJIMjQrczUJcF5ZjBJOfje96zz69lO+C3Xa1YbpSTBIbEo/at0gY7DNxErCCTxWg== X-Received: by 2002:a5d:9f57:0:b0:6dd:9df2:504e with SMTP id u23-20020a5d9f57000000b006dd9df2504emr53860863iot.18.1673817386984; Sun, 15 Jan 2023 13:16:26 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id j6-20020a6bf906000000b007046e9e138esm4329107iog.22.2023.01.15.13.16.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 13:16:26 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Heinrich Schuchardt , Simon Glass , Michal Simek , Ovidiu Panait Subject: [PATCH 05/24] timer: Tidy up use of notrace Date: Sun, 15 Jan 2023 14:15:42 -0700 Message-Id: <20230115211602.1127661-6-sjg@chromium.org> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog In-Reply-To: <20230115211602.1127661-1-sjg@chromium.org> References: <20230115211602.1127661-1-sjg@chromium.org> MIME-Version: 1.0 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Tracing is typically enabled by the time driver model starts up, so there is no point in adding a 'notrace' to the timer-init function. However, once the driver model timer is enabled, we do need to be able to access the timer's private data when reading the timer, so add it to the core function needed for that. Update the function's documentation while we are here. Signed-off-by: Simon Glass --- drivers/core/device.c | 3 ++- drivers/timer/timer-uclass.c | 2 +- include/timer.h | 13 +++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/core/device.c b/drivers/core/device.c index d9ce546c0c4..6e26b64fb81 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -654,7 +654,8 @@ void *dev_get_priv(const struct udevice *dev) return dm_priv_to_rw(dev->priv_); } -void *dev_get_uclass_priv(const struct udevice *dev) +/* notrace is needed as this is called by timer_get_rate() */ +notrace void *dev_get_uclass_priv(const struct udevice *dev) { if (!dev) { dm_warn("%s: null device\n", __func__); diff --git a/drivers/timer/timer-uclass.c b/drivers/timer/timer-uclass.c index bb719792135..f4b871ac23a 100644 --- a/drivers/timer/timer-uclass.c +++ b/drivers/timer/timer-uclass.c @@ -136,7 +136,7 @@ u64 timer_conv_64(u32 count) return ((u64)gd->timebase_h << 32) | gd->timebase_l; } -int notrace dm_timer_init(void) +int dm_timer_init(void) { struct udevice *dev = NULL; __maybe_unused ofnode node; diff --git a/include/timer.h b/include/timer.h index d33a26e28fe..311ce6b2c3a 100644 --- a/include/timer.h +++ b/include/timer.h @@ -9,11 +9,16 @@ #define timer_get_ops(dev) ((struct timer_ops *)(dev)->driver->ops) /** - * dm_timer_init() - initialize a timer for time keeping. On success - * initializes gd->timer so that lib/timer can use it for future - * referrence. + * dm_timer_init() - set up a timer for time keeping * - * Return: 0 on success or error number + * Sets up gd->timer if the device is not already bound, making sure it is + * probed and ready for use + * + * On success, inits gd->timer so that lib/timer can use it for future reference + * + * Returns: 0 on success, -EAGAIN if driver model is not ready yet, -ENODEV if + * no timer could be found, other error if the timer could not be bound or + * probed */ int dm_timer_init(void);