Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2473787rdb; Fri, 8 Dec 2023 09:06:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjr/i6IXhMXBXnnfKEZDaY/L9sOfjOqWSQz/XjQJmjV6sg1/EigfQw9YRAUHHGQpveHqYA X-Received: by 2002:a17:902:780f:b0:1cf:747e:89c6 with SMTP id p15-20020a170902780f00b001cf747e89c6mr282574pll.26.1702055197603; Fri, 08 Dec 2023 09:06:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702055197; cv=none; d=google.com; s=arc-20160816; b=dp/cgfMdfVHjs1s0vHFK2QlCy4zXZJ5kzde3WKjNFB9KYyyQh2JzHZP7TgUzTAjuUt qxo4mbaS1wOh5xXSy+uX9ME5/LJ1lcBUhVk7VEnU9mSWfkvyQoyOZ466etdaT0ve0Q/J SDqgXIKs/ojy55obhQcpnW3L7zMmnuJb+rTzdPoiov9X3Y+pECGoY/DxyeKezp3Dz1d1 OiBI7RZ8dfTEoY2hDngnk/+bJCH8k74qwNest/3Bftf369OYc0EHnP9nLH/U5JgfsPpy RFcvqn8FEW5IPo6xFkEcHlbiOQp/VFscFJcvvaRnks5DU546uAZcp5g3HwWtItX3DPwK sdqQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Rn6VbsoPDRrEIEsrIczCWkTGurdwFBv1Y0xRPqWrSKY=; fh=D0zHzE0rSeaV5xnFPtatb+q+bG5HGveof5GzyGf4cew=; b=Rh/UK6Mn+ibY6l4HALBOSgWa/WKj/cKmVJUOrPnpVPgukGDzVK+8lLnbY4IffeWt+C 7tTiaCJ+vqqJxkH6UIFqR6ZwhnwVb8kjmY6zZmEzBkeNmEyyBAxADldoV0EUWHcy2Ebs mqYFf2UoikIOUahDkdSdkZ4dJH9EVKK9gKJGyiQlbGoV44HfdvdO6VTMnfsZZHEvHG+K 2O7ZeMfHpaD1LvudHdtw5hLhf4qhS5+mZrlxQTDxgstEYq0nCE3Z/L5KAyZ88U3cVo7X 0HGdcA0PUoMvJJCshO90URaEEEVoSVpPMAEF8lcH9uWs3RMrBrHvEcIYm81MDwB6hihK Ek7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sEmmsggf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id 8-20020a631748000000b00565dd108fd4si1774450pgx.115.2023.12.08.09.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 09:06:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sEmmsggf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 25D3982E6C2B; Fri, 8 Dec 2023 09:06:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574023AbjLHRGU (ORCPT + 99 others); Fri, 8 Dec 2023 12:06:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233647AbjLHRGS (ORCPT ); Fri, 8 Dec 2023 12:06:18 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 776041989 for ; Fri, 8 Dec 2023 09:06:24 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86110C433C8; Fri, 8 Dec 2023 17:06:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702055184; bh=mxdO+AgZgxQrWokleW50XZOg/gCxBMjkuHhRTUdEc5U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sEmmsggfNl/uihEtJRxzo6AOd3cu/tKmCNiECPZP8J3nTetJtO4rgrUJ/gabq4bgh 6EiL1i+W6/pFlCfpM2ktnrMaC4iBA6rBKJfKk7R9g3lsAorl1x2yzyrzZrWJXZfStM rXanj2EgFeEqyKBb/VzQ7n5Md6Yby6VVBs/PajvHPRdxHOFNFnejMS4mY7W25Rx2JZ 6EWUshyUL5eV9KnyjyzGrtW21Gl+jOHoABb32yunQbM4SJ7H6Kw2Kpp+9CKpqfoJ6P 16PDdg/GGRmnijiS0z8ez/sc4fUt4IHyQI6WRn2ZvS8qHYl7jNXvuHaXn+d3655XBg G5ftfY37XvCOw== Date: Fri, 8 Dec 2023 22:36:09 +0530 From: Manivannan Sadhasivam To: Bean Huo Cc: avri.altman@wdc.com, bvanassche@acm.org, alim.akhtar@samsung.com, jejb@linux.ibm.com, martin.petersen@oracle.com, quic_cang@quicinc.com, quic_asutoshd@quicinc.com, beanhuo@micron.com, thomas@t-8ch.de, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, mikebi@micron.com, lporzio@micron.com Subject: Re: [PATCH v4 2/3] scsi: ufs: core: Add UFS RTC support Message-ID: <20231208170609.GD15552@thinkpad> References: <20231208103940.153734-1-beanhuo@iokpp.de> <20231208103940.153734-3-beanhuo@iokpp.de> <20231208145021.GC15552@thinkpad> <89c02f8b999a90329f2125380ad2d984767d25ae.camel@iokpp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <89c02f8b999a90329f2125380ad2d984767d25ae.camel@iokpp.de> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 08 Dec 2023 09:06:35 -0800 (PST) On Fri, Dec 08, 2023 at 04:12:44PM +0100, Bean Huo wrote: > On Fri, 2023-12-08 at 20:20 +0530, Manivannan Sadhasivam wrote: > > > +        */ > > > +       val = ts64.tv_sec - hba->dev_info.rtc_time_baseline; > > > + > > > > This logic will work if the host has RTC. But if there is no RTC, > > then tv_sec > > will return time elapsed since boot. The spec clearly states that > > host should > > use absolute mode if it has RTC and relative otherwise. > > > > Maybe you should add a logic to detect whether RTC is present or not > > and > > override the mode in device? > > Thank you for your reviews. I will incorporate the suggested changes > into the patch, addressing all comments except for the RTC mode switch. > The proposal is to perform the RTC mode switch during UFS provisioning, > not at runtime in the UFS online phase. This approach ensures that the > UFS configuration is populated based on the RTC configuration > established during provisioning. It is advisable not to change the RTC > mode after provisioning is complete. Additionally, the usage of tv_sec, > which returns time elapsed since boot, suggests that there is no issue > with utilizing the RTC in this context. Except that the warning will be issued to users after each 10s for 40 years. Atleast get rid of that. - Mani > > Kind regards, > Bean -- மணிவண்ணன் சதாசிவம்