lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1584576635.14250.63.camel@mtksdccf07>
Date:   Thu, 19 Mar 2020 08:10:35 +0800
From:   Stanley Chu <stanley.chu@...iatek.com>
To:     "Bean Huo (beanhuo)" <beanhuo@...ron.com>
CC:     "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "martin.peter~sen@...cle.com" <martin.peter~sen@...cle.com>,
        "avri.altman@....com" <avri.altman@....com>,
        "alim.akhtar@...sung.com" <alim.akhtar@...sung.com>,
        "jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
        "bvanassche@....org" <bvanassche@....org>,
        "asutoshd@...eaurora.org" <asutoshd@...eaurora.org>,
        "cang@...eaurora.org" <cang@...eaurora.org>,
        "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
        "linux-mediatek@...ts.infradead.org" 
        <linux-mediatek@...ts.infradead.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kuohong.wang@...iatek.com" <kuohong.wang@...iatek.com>,
        "peter.wang@...iatek.com" <peter.wang@...iatek.com>,
        "chun-hung.wu@...iatek.com" <chun-hung.wu@...iatek.com>,
        "andy.teng@...iatek.com" <andy.teng@...iatek.com>
Subject: RE: [EXT] [PATCH v7 3/7] scsi: ufs: introduce common and flexible
 delay function

Hi Bean,

On Wed, 2020-03-18 at 22:10 +0000, Bean Huo (beanhuo) wrote:
> Hi, Stanley
> > 
> > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index
> > 314e808b0d4e..a42a84164dec 100644
> > --- a/drivers/scsi/ufs/ufshcd.c
> > +++ b/drivers/scsi/ufs/ufshcd.c
> > @@ -597,6 +597,18 @@ static void ufshcd_print_pwr_info(struct ufs_hba *hba)
> >  		 hba->pwr_info.hs_rate);
> >  }
> > 
> > +void ufshcd_delay_us(unsigned long us, unsigned long tolerance) {
> > +	if (!us)
> > +		return;
> > +
> > +	if (us < 10)
> > +		udelay(us);
> > +	else
> > +		usleep_range(us, us + tolerance);
> > +}
> > +EXPORT_SYMBOL_GPL(ufshcd_delay_us);
> > +
> In this way, the callers of ufshcd_delay_us(), can directly call udelay() or usleep_range(), what is exist meaning of ufshcd_delay_us()?

Sure, the callers always can directly call udelay() or usleep_range().

The customizable delay (either by hosts or devices) value in UFS driver
is becoming more and more, like "reference clock gating delay" and
introduced "hce_enable_delay". The customized delay time could be 0, <
10 us, or >= 10 us in real cases. Hence this function can help driver
simplify the driver and user's decision of "just passed without any
delay" or "choosing a suitable delay function according to the delay
time".

Thanks,
Stanley Chu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ