From: Manivannan Sadhasivam <mani@kernel.org>
To: Bean Huo <beanhuo@iokpp.de>
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
Date: Fri, 8 Dec 2023 23:01:18 +0530 [thread overview]
Message-ID: <20231208173118.GE15552@thinkpad> (raw)
In-Reply-To: <20231208170609.GD15552@thinkpad>
On Fri, Dec 08, 2023 at 10:36:24PM +0530, Manivannan Sadhasivam wrote:
> 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.
>
I tried this series on Qcom RB5 board and found the issue due to the usage of
UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH flag. When this flag is set,
ufshcd_device_init() will be called twice due to reinit of the controller and
PHY.
Since RTC work is initialized and scheduled from ufshcd_device_init(), panic
happens during second time. Is it possible to move RTC init outside of
ufshcd_device_init(). Maybe you can parse RTC params in ufshcd_device_init()
and initialize the work elsewhere. Or you can cancel the work before calling
ufshcd_device_init() second time.
- Mani
> - Mani
>
> >
> > Kind regards,
> > Bean
>
> --
> மணிவண்ணன் சதாசிவம்
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2023-12-08 17:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 10:39 [PATCH v4 0/3] Add UFS RTC support Bean Huo
2023-12-08 10:39 ` [PATCH v4 1/3] scsi: ufs: core: Add ufshcd_is_ufs_dev_busy() Bean Huo
2023-12-08 12:48 ` Manivannan Sadhasivam
2023-12-08 10:39 ` [PATCH v4 2/3] scsi: ufs: core: Add UFS RTC support Bean Huo
2023-12-08 14:50 ` Manivannan Sadhasivam
2023-12-08 15:12 ` Bean Huo
2023-12-08 17:06 ` Manivannan Sadhasivam
2023-12-08 17:31 ` Manivannan Sadhasivam [this message]
2023-12-10 19:15 ` Bean Huo
2023-12-11 12:09 ` Manivannan Sadhasivam
2023-12-10 19:28 ` Bean Huo
2023-12-11 12:07 ` Manivannan Sadhasivam
2023-12-08 10:39 ` [PATCH v4 3/3] scsi: ufs: core: Add sysfs node for UFS RTC update Bean Huo
2023-12-08 10:57 ` [PATCH v4 0/3] Add UFS RTC support Thomas Weißschuh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231208173118.GE15552@thinkpad \
--to=mani@kernel.org \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@iokpp.de \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=lporzio@micron.com \
--cc=martin.petersen@oracle.com \
--cc=mikebi@micron.com \
--cc=quic_asutoshd@quicinc.com \
--cc=quic_cang@quicinc.com \
--cc=thomas@t-8ch.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox