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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 58A1EC433F5 for ; Fri, 15 Apr 2022 08:15:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2C9kTFAIW0u/VFW4Th3B4+/R6zdFWXdnTwclgucJ2kc=; b=D5LCt4Dq/9VLXl z+7flHjqhTJdFwZlUO006KF9z8uhFDZSkngiZdnVRusgXGVKtIgW0BSiMj3sPofpc4lPArmFUanVv Pdbsv29WY+bjCrgRSVOs1QoJFDlsdphVzceE7q+uGjJJ2eZY7C+Asjl1DJObqVuRSiWVGoqZQZe4m bOuYVdZlx4ef6CEuXb7zXF+58llBAO6IV/gg2nGrkUHUnmDgn1iLd/9+hn51AqLgpQgGZFyQQ9bDF wYSDTFNk3w4mG+6wYEJIgKEiVjxeElRNkcU4S/8pgTxToe3lF0dXyq9lHEl/jVnAj29rdHPN2+/XN l9/GOIBlUeHa7uhiat2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfH6F-009Gi2-1I; Fri, 15 Apr 2022 08:14:39 +0000 Received: from relay10.mail.gandi.net ([2001:4b98:dc4:8::230]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfH6A-009Gfu-NM for linux-arm-kernel@lists.infradead.org; Fri, 15 Apr 2022 08:14:37 +0000 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220415_011435_263959_E0D11225 X-CRM114-Status: GOOD ( 15.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel