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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C7F4C433FE for ; Fri, 15 Apr 2022 08:14:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351347AbiDOIRJ (ORCPT ); Fri, 15 Apr 2022 04:17:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349082AbiDOIRD (ORCPT ); Fri, 15 Apr 2022 04:17:03 -0400 Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [IPv6:2001:4b98:dc4:8::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E31CF6317; Fri, 15 Apr 2022 01:14:31 -0700 (PDT) Received: (Authenticated sender: alexandre.belloni@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 61C37240005; Fri, 15 Apr 2022 08:14:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1650010469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pKzyHpH5Bjb8iRoLHJukJctM0gcYG5sge5R4tzijau0=; b=gGZxFfuwsslvH4NphybsIpHaqITUT0Q9HkNGcVr+cb12cyRUcoYsz1UQTOk+H8DNHIARCm fxl1cg8HE7VG+Ok2pKSsFt6C8uY0FT7+4cKhR9S8Iar0wvP98Sve1oAHK0V0c8dsURyunV V0A/JVMxlp6ZmsG/RIfY+ASsWkNe5IYCM1oZ7bElD23VR9T/lnzyAoBo5RT31+TgDdPvR9 SqGSnO476l9EqRPxYwVVyPsVrXydhrnIqcHR6G/1rUyDUuD40V7mfIa/iLCIi4uGvdicJb UfAtW2d64HTNXSFcyBPqxfOfTYIKBln0lZoLCNUp5LkGdgnjXXj7o63ukeExwA== Date: Fri, 15 Apr 2022 10:14:27 +0200 From: Alexandre Belloni To: Vignesh Raghavendra Cc: Nishanth Menon , Krzysztof Kozlowski , Rob Herring , Alessandro Zummo , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/2] rtc: Introduce ti-k3-rtc Message-ID: References: <20220412073138.25027-1-nm@ti.com> <20220412073138.25027-3-nm@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 15/04/2022 13:33:14+0530, Vignesh Raghavendra wrote: > Hi, > > On 12/04/22 1:01 pm, Nishanth Menon wrote: > > +/** > > + * k3rtc_fence - Ensure a register sync took place between the two domains > > + * @priv: pointer to priv data > > + * > > + * Return: 0 if the sync took place, else returns -ETIMEDOUT > > + */ > > +static int k3rtc_fence(struct ti_k3_rtc *priv) > > +{ > > + u32 timeout = priv->sync_timeout_us; > > + u32 mask = K3RTC_RD_PEND_BIT | K3RTC_WR_PEND_BIT; > > + u32 val = 0; > > + > > + while (timeout--) { > > + val = k3rtc_readl(priv, REG_K3RTC_SYNCPEND); > > + if (!(val & mask)) > > + return 0; > > + usleep_range(1, 2); > > + } > > readl_poll_timeout() ? > > > + > > + pr_err("RTC Fence timeout: 0x%08x\n", val); > > Can we use dev_err()? Provides better indication of the driver throwing > error. > What would the user do with this information in the kernel logs? Please do not add error strings that will never be used. Returning -ETIMEDOUT is probably enough. > > + return -ETIMEDOUT; > > +} > > + -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com