Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp37221lfe; Fri, 15 Apr 2022 18:16:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7U46glzxy9QtoXtNnZPUkbMhdPYkGowAH0eJ8ioOGf4pNhM9bunor6UfbezljXPiUzQ6C X-Received: by 2002:a17:902:7e0d:b0:156:47a4:a7c4 with SMTP id b13-20020a1709027e0d00b0015647a4a7c4mr1609815plm.141.1650071778254; Fri, 15 Apr 2022 18:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650071778; cv=none; d=google.com; s=arc-20160816; b=L6oNqvUoDsYiczLQykOWTqzON02W+rTGAfWQaD38FnSiSx2OXTf1CJ44BgWxI7Pq8g ZkWG9rgEVCxDyP/EPhaVc5dqSo48hBMbQ4NmdpPlG3J/0pETD8K0pZPt2rpYXF2ZaOfX CkLztKVo+Lui1NK69su2TeA7ztxAtOfHn7FaEKKBPDGbYdimrO+k+Ea3VA/U9KFNtfM3 pahoSrGOl7QHx/o4yzJQyNUO2csoVKRWaJw/lkxD4V7eMZJDiTKOPuhrVH3FQt9HDAYv h4LXC/4YhaUeurHKqexcphH7a5pMe6TOpZN7gb0zU1IYhMvIZPmL/iosqx9mLEeuBQ/L ae/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pKzyHpH5Bjb8iRoLHJukJctM0gcYG5sge5R4tzijau0=; b=ahWe72hxfstq7DX1pSs4nfHbFCTssis/DWb/CkzW2QQZ0+ItHF8yG8XgCrJRNJCANI Kq7m6rdLYBW1XY163owZhnsqPxavEu2LVKLu+EZk4n8/AwqKSHLxNyiW17GNaPQxCOmA Ive/PNKJoIl6h3HYrpSh344y4lKt4WDpLLlwpm/3UDl50sfEJTUr4PFkwR4oyWxANaL0 gi3s/v2XLlbQKHF3ovDd2PlN/a6qavzFL0uQeLLiGI0rDtCufs/TbaD+SBeac1OJecvl r52noABucCoMplp8UddRJabo7NC2K7+nkWzUR9Ek3qB6ifI8JLK0eeEyRaHUygFFr3ij qxPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=gGZxFfuw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b17-20020a170902e95100b001586fb0260asi2819980pll.218.2022.04.15.18.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 18:16:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=gGZxFfuw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4FCAA5714C; Fri, 15 Apr 2022 17:52:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233212AbiDOIRL (ORCPT + 99 others); Fri, 15 Apr 2022 04:17:11 -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: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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