Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2612238rdb; Wed, 15 Nov 2023 06:02:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IF84Rk0ZXbgtXADl68yhacseIuLcDZbDbQSTJSeOtSrxaksEXsgc7RVH8B7oFYmt8mCDXWD X-Received: by 2002:a05:6808:f87:b0:3b2:e469:904c with SMTP id o7-20020a0568080f8700b003b2e469904cmr17171554oiw.28.1700056963691; Wed, 15 Nov 2023 06:02:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700056963; cv=pass; d=google.com; s=arc-20160816; b=mCHguQrJBTo0Ip7kavUf7W4U3U34uBaY19GFQ0ZoRdZk8978UlWfU4kGFv89DNsDNm ysS02JpCcmmK/4yCWgW/FPzMH9n+xUNV4e0K0ZJfxGjR2FlInftU3nopGyQJvX9qM/6l jGlfjpNryn+IXpuI8Gx6ga+z4BSzlOkkgB9NGsEp5OoMQlpxpOROVlyR6uk7wWSDbvgK D42yQ8r8gI/GNV96+tOKeS4PL4psLlwlCir7L6cD7i/tVDNIu9w0uWr8Y346iM9/iHF0 wRg0hgaXWCi51hGds83FXVyF4SJaIhhBV3pddHoWfS7q1M/FfU1iyFyBiaja11JagtFj o3+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature:dkim-signature; bh=4Fhd9W6J/FtHQb3eqvYxGekeP1iAWCQi63b2vIat1w0=; fh=5y6U8+s3P3QqBPkZ0gRUB/SaGDhe37scapudZNqzMtI=; b=hRixWrsPfdTnLFdlN1pH95XzfbaitXOopX29vK2+TcVBvugt/kxHOiXHhy4KZJMuLB 6P8Xvhx6CG1MCVFWbriEm+69aOEjBe1Ce2P2z7o94dAOqA24966Cc79s617kB4BPCCMP xFYiLWvcjP20UYZ296NeTthj/fvXy9qZq92hkgaRmScBBrlhZge6grkFkgql2SEj6Mgf EyX27BPvhKI5ShMdaiZKPVvA84FTkXvLviqVlDqxNoH74yMekj8sjo5F0Z6j8mIx+mOb XudGJOs6SPxdThCAOyxi37qbIHi7QETdGuAmgGo7YwxPRmGXaFI6TqYAIPF4UAcI7yWe qNcw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@iokpp.de header.s=strato-dkim-0002 header.b=ovAo1WP0; dkim=neutral (no key) header.i=@iokpp.de header.s=strato-dkim-0003 header.b=G783veHr; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id e12-20020a056808148c00b003b2eabc722asi3589302oiw.41.2023.11.15.06.02.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 06:02:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@iokpp.de header.s=strato-dkim-0002 header.b=ovAo1WP0; dkim=neutral (no key) header.i=@iokpp.de header.s=strato-dkim-0003 header.b=G783veHr; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EEBE380EE0DB; Tue, 14 Nov 2023 10:27:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233925AbjKNS14 (ORCPT + 99 others); Tue, 14 Nov 2023 13:27:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233859AbjKNS1y (ORCPT ); Tue, 14 Nov 2023 13:27:54 -0500 Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [85.215.255.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E43E3B8; Tue, 14 Nov 2023 10:27:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699986459; cv=none; d=strato.com; s=strato-dkim-0002; b=mzUaepfHhzXgDeJKxkzqqhgWKiGR4TxvBnIvqh865ge4WBNYl0BfIyEGcc1qfCfMnW T9rhaaM/bbxo2KCknbLFiCXrRA5FghIEo9bA7idXpXiqFKb8g6aVCqz76604Rjkzgg/M hLLqZ/uPf+AqfDzjnH4vmmibtYl3ukDfVQShiOcHhf2XpwPu8tIMra2f4yHkj4O2c6P+ 9vTEwqcM4eW6mCT9mjfKv5D8A9oLI1ryWGc/pvpt0eFwUs68+bVuius7Ob/omSy4fU/N w8XQdWGlV9kc8fyGIt8ZAENZtsG7ipzkmqmR5rZPZ68eROlLpYr/CLS+jgPkwGAH1e3w Cs2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1699986459; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Cc:Date: From:Subject:Sender; bh=4Fhd9W6J/FtHQb3eqvYxGekeP1iAWCQi63b2vIat1w0=; b=qhX8OGKxnwgIOdWmhxCU6UegTVHzZCpXdKJjJEyXgR0aQts78FRI8hDwQzy+R4qB6o nZ16JIBA94xKMyiSc3DOX0JFPmEI+8WgzU98PqtzF9+bbafQU6UnQMwj2CJiPY4ttQ4l ma/ra9rr8bg6igz2TDMSXwfmO3u1sq9960Z5VQTko+ossgTo2oZHxy7YBxVLTbEXHJQY gfIVp1zt/iIehJ3KNh3QXIMlgI0zQzXky1VexowvOZrm0l9nErts7Dczzh2rwu+jnk8a +SAwIeO4olDiOfKAdIYxxfa2hRiTgBh4Yzn54FSZg8DjODSEBaFSdpg6BuHmROIYwEh+ 7P+g== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo01 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1699986459; s=strato-dkim-0002; d=iokpp.de; h=References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Cc:Date: From:Subject:Sender; bh=4Fhd9W6J/FtHQb3eqvYxGekeP1iAWCQi63b2vIat1w0=; b=ovAo1WP0thWJyLYpyf0ZOtDxDlSoneEG4XXdY/FM1OJOFzGT+LMyqwMexwmPvEymb2 KgTLaSz1iQsVXCt5M8GtzzIp+4Oc2KFNUJeTeeanIZh3x9MoPkjpSM/mJngLxCoThcFp BYw6rINitFfKJSs2TxTXwCdFLr13wyyXd81BA6F9k/vtrQdD0APp50zuigT8luesryOf AH8KFr84+Yx4FDM3RsuvtvOhQfe1PC30ALjVbSi79q/t7s/sEqW/YBSSuBYz/K7gWc1x Gk+uQFbAMosziq1ySjRBn3bMGkpxJxPwHgUmj+PtVWsi4f6ct8WxWyOBNO7F/Y2Xdp07 FRnw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1699986459; s=strato-dkim-0003; d=iokpp.de; h=References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Cc:Date: From:Subject:Sender; bh=4Fhd9W6J/FtHQb3eqvYxGekeP1iAWCQi63b2vIat1w0=; b=G783veHrx+NScB8fyeyZgWUR5XBAVMv3j6BTLYsbDIPykBlPXu+M5eFGK45aH6jPf9 MjsOA/eDOuCg/WoVdbCg== X-RZG-AUTH: ":LmkFe0i9dN8c2t4QQyGBB/NDXvjDB6pBSeBwhhSxarlUcu05JCAPyj3VPAceccYJs0uz" Received: from [10.176.235.177] by smtp.strato.de (RZmta 49.9.1 AUTH) with ESMTPSA id z758a5zAEIRcV7n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 14 Nov 2023 19:27:38 +0100 (CET) Message-ID: Subject: Re: [PATCH v1 1/2] scsi: ufs: core: Add UFS RTC support From: Bean Huo To: Thomas =?ISO-8859-1?Q?Wei=DFschuh?= Cc: avri.altman@wdc.com, bvanassche@acm.org, alim.akhtar@samsung.com, jejb@linux.ibm.com, martin.petersen@oracle.com, stanley.chu@mediatek.com, mani@kernel.org, quic_cang@quicinc.com, quic_asutoshd@quicinc.com, beanhuo@micron.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, mikebi@micron.com, lporzio@micron.com Date: Tue, 14 Nov 2023 19:27:37 +0100 In-Reply-To: References: <20231109125217.185462-1-beanhuo@iokpp.de> <20231109125217.185462-2-beanhuo@iokpp.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 14 Nov 2023 10:27:58 -0800 (PST) Hi Thomas, Thank you for your review. I will resolve the highlighted issue in the upcoming version.=C2=A0Two separate questions that require individual answers as below:=20 On Thu, 2023-11-09 at 15:05 +0100, Thomas Wei=C3=9Fschuh wrote: > > =C2=A0 static int ufs_get_device_desc(struct ufs_hba *hba) > > =C2=A0 { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0int err; > > @@ -8237,6 +8321,8 @@ static int ufs_get_device_desc(struct ufs_hba > > *hba) > > =C2=A0=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ufshcd_temp_notif_probe= (hba, desc_buf); > > =C2=A0=20 > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0ufs_init_rtc(hba, desc_buf); > > + >=20 > As somebody with no idea and no access to the specs: >=20 > Is this available for all devices and all protocol versions? >=20 > >=20 I would like to mention that while I cannot confirm that RTC works on all protocol versions, it has been consistently functional on all devices in the market since the introduction of UFS 2.0, which also introduced RTC. I am not aware of any UFS version lower than 2.0 currently available on the market. In the event that a vendor has a product with a lower UFS version, we can consider implementing a version check. > >=20 > >=20 > >=20 >=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0goto out; > > =C2=A0=20 > > =C2=A0 set_link_active: > > @@ -9840,6 +9930,8 @@ static int __ufshcd_wl_resume(struct ufs_hba > > *hba, enum ufs_pm_op pm_op) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0if (ret) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= goto set_old_link_state; > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0ufshcd_set_timestamp_attr(hba); > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0schedule_delayed_work(&hba->ufs_rtc_delayed_work, > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0msecs_to_ji > > ffies(UFS_RTC_UPDATE_EVERY_MS)); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > > =C2=A0=20 > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (ufshcd_keep_autobko= ps_enabled_except_suspend(hba)) > > diff --git a/include/ufs/ufs.h b/include/ufs/ufs.h > > index e77ab1786856..18b39c6b3a97 100644 > > --- a/include/ufs/ufs.h > > +++ b/include/ufs/ufs.h > > @@ -14,6 +14,7 @@ > > =C2=A0 #include > > =C2=A0 #include > > =C2=A0 #include > > +#include >=20 > Seems unnecessary. seems it's needed, otherwise, I will get: ./include/ufs/ufs.h:599:9: error: unknown type name =E2=80=98time64_t=E2=80= =99 Kind regards, Bean