mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bean Huo <beanhuo@iokpp.de>
To: Bart Van Assche <bvanassche@acm.org>,
	avri.altman@wdc.com, alim.akhtar@samsung.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com, mani@kernel.org,
	quic_cang@quicinc.com, quic_asutoshd@quicinc.com,
	beanhuo@micron.com, thomas@t-8ch.de
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	mikebi@micron.com, lporzio@micron.com
Subject: Re: [PATCH v3 2/3] scsi: ufs: core: Add UFS RTC support
Date: Fri, 08 Dec 2023 00:02:33 +0100	[thread overview]
Message-ID: <887dec18bdaec3cc048f0f4d5c0391dc338e3828.camel@iokpp.de> (raw)
In-Reply-To: <b5819922-60e0-4701-84d4-05c76d2ea5ec@acm.org>

On Wed, 2023-12-06 at 14:59 -1000, Bart Van Assche wrote:
> A 64-bit value is truncated to a 32-bit value. What should happen if
> the
> right hand side is larger than what fits into a 32-bit integer?
> Should
> a comment perhaps be added that uptimes of more than 136 years are
> not
> supported and also for absolute times that the above code fails after
> the year 2010 + 136 = 2146?
> 
> Thanks,
> 
> Bart.


Bart,

you are taking into account a broader perspective. thanks for your
review!

I will add below code in the next version:


+       if  (ts64.tv_sec < hba->dev_info.rtc_time_baseline) {
+               dev_warn(hba->dev, "%s: Current time precedes previous
setting!\n", __func__);
+               return;
+       }
+       /*
+        * Absolute RTC mode has 136-year limit as of 2010. Modify UFS
Spec or choosing relative
+        * RTC mode for longer (beyond year 2146) time spans.
+        */


Kind regards,
Bean

  reply	other threads:[~2023-12-07 23:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-02 16:02 [PATCH v3 0/3] " Bean Huo
2023-12-02 16:02 ` [PATCH v3 1/3] scsi: ufs: core: Add ufshcd_is_ufs_dev_busy() Bean Huo
2023-12-06 19:36   ` Avri Altman
2023-12-02 16:02 ` [PATCH v3 2/3] scsi: ufs: core: Add UFS RTC support Bean Huo
2023-12-04 12:13   ` Avri Altman
2023-12-04 12:23     ` Avri Altman
2023-12-06 19:38   ` Avri Altman
2023-12-07  0:59   ` Bart Van Assche
2023-12-07 23:02     ` Bean Huo [this message]
2023-12-02 16:02 ` [PATCH v3 3/3] scsi: ufs: core: Add sysfs node for UFS RTC update Bean Huo
2023-12-06 19:39   ` Avri Altman
2023-12-06 17:08 ` [PATCH v3 0/3] Add UFS RTC support Bean Huo

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=887dec18bdaec3cc048f0f4d5c0391dc338e3828.camel@iokpp.de \
    --to=beanhuo@iokpp.de \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --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=mani@kernel.org \
    --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

all inboxes | Powered by JetHome®