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: <1413119B-8B9C-4DE4-A086-476B2BAA60AD@linaro.org>
Date:   Fri, 15 Sep 2023 05:31:45 +0300
From:   Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To:     Can Guo <quic_cang@...cinc.com>,
        Konrad Dybcio <konrad.dybcio@...aro.org>, mani@...nel.org,
        quic_nguyenb@...cinc.com, quic_nitirawa@...cinc.com,
        martin.petersen@...cle.com
CC:     linux-scsi@...r.kernel.org, Andy Gross <agross@...nel.org>,
        Bjorn Andersson <andersson@...nel.org>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "open list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER..." 
        <linux-arm-msm@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/6] scsi: ufs: ufs-qcom: Add support for UFS device version detection

On 11 September 2023 13:02:50 GMT+03:00, Can Guo <quic_cang@...cinc.com> wrote:
>
>On 9/11/2023 5:46 PM, Konrad Dybcio wrote:
>> On 11.09.2023 11:42, Can Guo wrote:
>>> Hi Konrad,
>>> 
>>> On 9/11/2023 5:17 PM, Konrad Dybcio wrote:
>>>> On 11.09.2023 07:59, Can Guo wrote:
>>>>> From: "Bao D. Nguyen" <quic_nguyenb@...cinc.com>
>>>>> 
>>>>> Retrieve UFS device version from UFS host controller's spare register
>>>>> which is populated by bootloader, and use the UFS device version together
>>>>> with host controller's HW version to decide the proper power modes which
>>>>> should be used to configure the UFS PHY.
>>>> That sounds a bit fishy.. is there no bootloader-independent
>>>> solution to that? Can't we bring in the code that the bootloader
>>>> uses to determine these values?
>>>> 
>>>> Konrad
>>> 
>>> Agree, it is.
>>> 
>>> 
>>> All these complexities come from one request from PHY design team - power saving.
>>> 
>>> And to achieve power saving, Qualcomm UFS developers are requested to use the
>>> 
>>> lowest hanging PHY settings which can sustain the Max agreed HS Gear (btw host
>>> 
>>> and UFS device) during UFS's lifecycle in High Level OS,  whereas the power saving
>>> 
>>> request does not apply to bootloader, which works for only a few seconds during
>>> 
>>> bootup. Hence, there is no such version detect code in bootloader -  it just uses the
>>> 
>>> highest PHY settings to configure PHY, boot up UFS and put UFS device version in this
>>> 
>>> register.
>> First of all, your email client seems to be inserting 2 newlines
>> instead of 1. If you're using thunderbird, you may want to edit:
>> 
>> mail.identity.(default or your mail identity idx).default.compose_html
>> 
>> to `false`
>> 
>> and add that to your internal wiki page, as I see many @quic folks having
>> this issue.
>> 
>> 
>> Going back to the main topic, I don't think we understood each other.
>> The commit message states:
>> 
>> 
>> "Retrieve UFS device version from UFS host controller's spare register
>> which is populated by bootloader"
>> 
>> 
>> Which means the bootloader is able to somehow determine the value
>> that's in the spare register and write it there.
>> 
>> I'm asking whether we can take the logic behind this value and
>> move it to Linux so that we don't depend on the bootloader to
>> guarantee it (e.g. Chrome or some other devices with more exotic
>> fw may not work this way).
>> 
>> 
>> Konrad
>
>
>There is no logic behind this value at all in bootloader, as I explained, after bootloader
>
>initializes UFS, bootloader simply reads UFS's device version (the value you are referring)
>
>and write it to the register. But in Linux kernel, we need (or want to know) this value
>
>BEFORE we initialize UFS host controller (and UFS device).

Depending on the bootloader behaviour is not an option. For example the kernel might be started via kexec. Or via u-boot. Or grub. Or any other bootloader. So please duplicate the logic to read the UFS version instead.


P.S. you have been asked to fix your email client. Please do so. Or, if you are inserting these linebreaks manually, please stop.

>Thanks,
>
>Can Guo.
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ