mbox series

[00/13] ufs: enhancements to support Qualcomm UFS controllers

Message ID 20240910-topic-ufs-enhancements-v1-0-3ee0bffacc64@linaro.org
Headers show
Series ufs: enhancements to support Qualcomm UFS controllers | expand

Message

Neil Armstrong Sept. 10, 2024, 9:20 a.m. UTC
This serie regroups all the fixes and base enhancements required to
support the Qualcomm UFS controllers in U-Boot.

This syncs headers & defines from Linux, and includes 2 set of
fixes that were sent separately:
- ufs: core: remove link_startup_again logic
- ufs: properly fix cache operations

Without those 2 sets, UFS cannot initialize on Qualcomm controlers
since v5, and a numerous of Cache issues makes any UFS controller
fail to initialize.

Since UFS core hasn't changed for a while, and since UFS is core
technology for the Qualcomm SoCs, I volunteer maintaininig the
UFS subsystem if Bhupesh & Neha Malcom Francis are ok with that.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Bhupesh Sharma (5):
      ufs/ufs.h: Add definition of 'ufshcd_rmwl()'
      ufs: Clear UECPA once due to LINERESET has happened during LINK_STARTUP
      ufs: Sync possible UFS Quirks with Linux UFS driver
      ufs: Add missing memory barriers
      ufs: Fix debug message in 'ufs_start'

Marek Vasut (2):
      ufs: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS
      ufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTO

Neil Armstrong (6):
      ufs: allocate descriptors with size aligned with DMA_MINALIGN
      ufs: fix dcache flush and invalidate range calculation
      ufs: split flush and invalidate to only invalidate when required
      ufs: use dcache helpers for scsi_cmd data and only invalidate if necessary
      ufs: core: remove link_startup_again logic
      MAINTAINERS: Add myself to the list of UFS maintainers

 MAINTAINERS       |   1 +
 drivers/ufs/ufs.c |  98 ++++++++++++++++++++--------------
 drivers/ufs/ufs.h | 157 +++++++++++++++++++++++++++++++++++++++++++++++-------
 3 files changed, 197 insertions(+), 59 deletions(-)
---
base-commit: ca55cf8104c0dd78aae45fa66dd8400ef1b3d0ac
change-id: 20240910-topic-ufs-enhancements-fe8ef9ce39d8

Best regards,

Comments

Neil Armstrong Sept. 18, 2024, 8:06 a.m. UTC | #1
Hi Marek, Manorit, Tom, Michal,

On 10/09/2024 11:20, Neil Armstrong wrote:
> This serie regroups all the fixes and base enhancements required to
> support the Qualcomm UFS controllers in U-Boot.
> 
> This syncs headers & defines from Linux, and includes 2 set of
> fixes that were sent separately:
> - ufs: core: remove link_startup_again logic
> - ufs: properly fix cache operations
> 
> Without those 2 sets, UFS cannot initialize on Qualcomm controlers
> since v5, and a numerous of Cache issues makes any UFS controller
> fail to initialize.
> 
> Since UFS core hasn't changed for a while, and since UFS is core
> technology for the Qualcomm SoCs, I volunteer maintaininig the
> UFS subsystem if Bhupesh & Neha Malcom Francis are ok with that.

Could you run this serie on the r8a779f0_spider, j721s2_evm_a72, j721e_evm_a72,
j7200_evm_a72, amd_versal2_virt and qemu-riscv and check for possible regressions ?

It seems the only user of UFS_PCI is qemu-riscv, is there other users ?

Thanks,
Neil

> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
> Bhupesh Sharma (5):
>        ufs/ufs.h: Add definition of 'ufshcd_rmwl()'
>        ufs: Clear UECPA once due to LINERESET has happened during LINK_STARTUP
>        ufs: Sync possible UFS Quirks with Linux UFS driver
>        ufs: Add missing memory barriers
>        ufs: Fix debug message in 'ufs_start'
> 
> Marek Vasut (2):
>        ufs: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS
>        ufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTO
> 
> Neil Armstrong (6):
>        ufs: allocate descriptors with size aligned with DMA_MINALIGN
>        ufs: fix dcache flush and invalidate range calculation
>        ufs: split flush and invalidate to only invalidate when required
>        ufs: use dcache helpers for scsi_cmd data and only invalidate if necessary
>        ufs: core: remove link_startup_again logic
>        MAINTAINERS: Add myself to the list of UFS maintainers
> 
>   MAINTAINERS       |   1 +
>   drivers/ufs/ufs.c |  98 ++++++++++++++++++++--------------
>   drivers/ufs/ufs.h | 157 +++++++++++++++++++++++++++++++++++++++++++++++-------
>   3 files changed, 197 insertions(+), 59 deletions(-)
> ---
> base-commit: ca55cf8104c0dd78aae45fa66dd8400ef1b3d0ac
> change-id: 20240910-topic-ufs-enhancements-fe8ef9ce39d8
> 
> Best regards,
Michal Simek Sept. 18, 2024, 9:03 a.m. UTC | #2
Hi Neil,

On 9/18/24 10:06, Neil Armstrong wrote:
> Hi Marek, Manorit, Tom, Michal,
> 
> On 10/09/2024 11:20, Neil Armstrong wrote:
>> This serie regroups all the fixes and base enhancements required to
>> support the Qualcomm UFS controllers in U-Boot.
>>
>> This syncs headers & defines from Linux, and includes 2 set of
>> fixes that were sent separately:
>> - ufs: core: remove link_startup_again logic
>> - ufs: properly fix cache operations
>>
>> Without those 2 sets, UFS cannot initialize on Qualcomm controlers
>> since v5, and a numerous of Cache issues makes any UFS controller
>> fail to initialize.
>>
>> Since UFS core hasn't changed for a while, and since UFS is core
>> technology for the Qualcomm SoCs, I volunteer maintaininig the
>> UFS subsystem if Bhupesh & Neha Malcom Francis are ok with that.
> 
> Could you run this serie on the r8a779f0_spider, j721s2_evm_a72, j721e_evm_a72,
> j7200_evm_a72, amd_versal2_virt and qemu-riscv and check for possible regressions ?
> 
> It seems the only user of UFS_PCI is qemu-riscv, is there other users ?


Good timing. We are close to send some updates to UFS which we require to get 
DWC version to work inside U-Boot.

How far are that core changes from Linux? I see 9/13 is sync with Linux but when 
this is done you should also say which Linux version was used for sync.

I see that there are definitely some kernel-doc issues

Also s/U-boot/U-Boot/g

Venkatesh: Can you please look at this patch series and validate it on our 
platform? Also make sense to send our changes to make sure that they won't break 
others.

Thanks,
Michal
Abbarapu, Venkatesh Sept. 18, 2024, 9:32 a.m. UTC | #3
Hi Michal,

> -----Original Message-----
> From: Simek, Michal <michal.simek@amd.com>
> Sent: Wednesday, September 18, 2024 2:33 PM
> To: neil.armstrong@linaro.org; Marek Vasut <marek.vasut+renesas@mailbox.org>;
> Neha Malcom Francis <n-francis@ti.com>; Manorit Chawdhry <m-
> chawdhry@ti.com>; Tom Rini <trini@konsulko.com>; bmeng.cn@gmail.com;
> Abbarapu, Venkatesh <venkatesh.abbarapu@amd.com>
> Cc: u-boot@lists.denx.de; u-boot-qcom@groups.io; Bhupesh Sharma
> <bhupesh.linux@gmail.com>
> Subject: Re: [PATCH 00/13] ufs: enhancements to support Qualcomm UFS
> controllers
> 
> Hi Neil,
> 
> On 9/18/24 10:06, Neil Armstrong wrote:
> > Hi Marek, Manorit, Tom, Michal,
> >
> > On 10/09/2024 11:20, Neil Armstrong wrote:
> >> This serie regroups all the fixes and base enhancements required to
> >> support the Qualcomm UFS controllers in U-Boot.
> >>
> >> This syncs headers & defines from Linux, and includes 2 set of fixes
> >> that were sent separately:
> >> - ufs: core: remove link_startup_again logic
> >> - ufs: properly fix cache operations
> >>
> >> Without those 2 sets, UFS cannot initialize on Qualcomm controlers
> >> since v5, and a numerous of Cache issues makes any UFS controller
> >> fail to initialize.
> >>
> >> Since UFS core hasn't changed for a while, and since UFS is core
> >> technology for the Qualcomm SoCs, I volunteer maintaininig the UFS
> >> subsystem if Bhupesh & Neha Malcom Francis are ok with that.
> >
> > Could you run this serie on the r8a779f0_spider, j721s2_evm_a72,
> > j721e_evm_a72, j7200_evm_a72, amd_versal2_virt and qemu-riscv and check for
> possible regressions ?
> >
> > It seems the only user of UFS_PCI is qemu-riscv, is there other users ?
> 
> 
> Good timing. We are close to send some updates to UFS which we require to get
> DWC version to work inside U-Boot.
> 
> How far are that core changes from Linux? I see 9/13 is sync with Linux but when
> this is done you should also say which Linux version was used for sync.
> 
> I see that there are definitely some kernel-doc issues
> 
> Also s/U-boot/U-Boot/g
> 
> Venkatesh: Can you please look at this patch series and validate it on our platform?
> Also make sense to send our changes to make sure that they won't break others.
I will pull these changes and try on our platform.

Thanks
Venkatesh
> 
> Thanks,
> Michal
Neil Armstrong Sept. 18, 2024, 10:40 a.m. UTC | #4
Hi,

On 18/09/2024 11:03, Michal Simek wrote:
> Hi Neil,
> 
> On 9/18/24 10:06, Neil Armstrong wrote:
>> Hi Marek, Manorit, Tom, Michal,
>>
>> On 10/09/2024 11:20, Neil Armstrong wrote:
>>> This serie regroups all the fixes and base enhancements required to
>>> support the Qualcomm UFS controllers in U-Boot.
>>>
>>> This syncs headers & defines from Linux, and includes 2 set of
>>> fixes that were sent separately:
>>> - ufs: core: remove link_startup_again logic
>>> - ufs: properly fix cache operations
>>>
>>> Without those 2 sets, UFS cannot initialize on Qualcomm controlers
>>> since v5, and a numerous of Cache issues makes any UFS controller
>>> fail to initialize.
>>>
>>> Since UFS core hasn't changed for a while, and since UFS is core
>>> technology for the Qualcomm SoCs, I volunteer maintaininig the
>>> UFS subsystem if Bhupesh & Neha Malcom Francis are ok with that.
>>
>> Could you run this serie on the r8a779f0_spider, j721s2_evm_a72, j721e_evm_a72,
>> j7200_evm_a72, amd_versal2_virt and qemu-riscv and check for possible regressions ?
>>
>> It seems the only user of UFS_PCI is qemu-riscv, is there other users ?
> 
> 
> Good timing. We are close to send some updates to UFS which we require to get DWC version to work inside U-Boot.
> 
> How far are that core changes from Linux? I see 9/13 is sync with Linux but when this is done you should also say which Linux version was used for sync.

I think we are still quite far from Linux, we just took the basic required bits and pieces
to at least make the Qcom UFS controller driver build work, but Linux driver is overly complicated
with power management code we do not really need in U-Boot, so it's quite hard to sync honestly.

But the plan is to align as much as possible once we get the basic Qcom UFS mainline.

> 
> I see that there are definitely some kernel-doc issues
> 
> Also s/U-boot/U-Boot/g

Ack, will check

> 
> Venkatesh: Can you please look at this patch series and validate it on our platform? Also make sense to send our changes to make sure that they won't break others.
> 
> Thanks,
> Michal

Thanks,
Neil
Michal Simek Sept. 18, 2024, 10:47 a.m. UTC | #5
On 9/18/24 12:40, neil.armstrong@linaro.org wrote:
> Hi,
> 
> On 18/09/2024 11:03, Michal Simek wrote:
>> Hi Neil,
>>
>> On 9/18/24 10:06, Neil Armstrong wrote:
>>> Hi Marek, Manorit, Tom, Michal,
>>>
>>> On 10/09/2024 11:20, Neil Armstrong wrote:
>>>> This serie regroups all the fixes and base enhancements required to
>>>> support the Qualcomm UFS controllers in U-Boot.
>>>>
>>>> This syncs headers & defines from Linux, and includes 2 set of
>>>> fixes that were sent separately:
>>>> - ufs: core: remove link_startup_again logic
>>>> - ufs: properly fix cache operations
>>>>
>>>> Without those 2 sets, UFS cannot initialize on Qualcomm controlers
>>>> since v5, and a numerous of Cache issues makes any UFS controller
>>>> fail to initialize.
>>>>
>>>> Since UFS core hasn't changed for a while, and since UFS is core
>>>> technology for the Qualcomm SoCs, I volunteer maintaininig the
>>>> UFS subsystem if Bhupesh & Neha Malcom Francis are ok with that.
>>>
>>> Could you run this serie on the r8a779f0_spider, j721s2_evm_a72, j721e_evm_a72,
>>> j7200_evm_a72, amd_versal2_virt and qemu-riscv and check for possible 
>>> regressions ?
>>>
>>> It seems the only user of UFS_PCI is qemu-riscv, is there other users ?
>>
>>
>> Good timing. We are close to send some updates to UFS which we require to get 
>> DWC version to work inside U-Boot.
>>
>> How far are that core changes from Linux? I see 9/13 is sync with Linux but 
>> when this is done you should also say which Linux version was used for sync.
> 
> I think we are still quite far from Linux, we just took the basic required bits 
> and pieces
> to at least make the Qcom UFS controller driver build work, but Linux driver is 
> overly complicated
> with power management code we do not really need in U-Boot, so it's quite hard 
> to sync honestly.
> 
> But the plan is to align as much as possible once we get the basic Qcom UFS 
> mainline.

That's understandable. But even when you say sync with Linux for some headers, 
etc it is good to say that it is sync with 6.11 for example.

Thanks,
Michal
Neil Armstrong Sept. 19, 2024, 7:52 a.m. UTC | #6
On 18/09/2024 12:47, Michal Simek wrote:
> 
> 
> On 9/18/24 12:40, neil.armstrong@linaro.org wrote:
>> Hi,
>>
>> On 18/09/2024 11:03, Michal Simek wrote:
>>> Hi Neil,
>>>
>>> On 9/18/24 10:06, Neil Armstrong wrote:
>>>> Hi Marek, Manorit, Tom, Michal,
>>>>
>>>> On 10/09/2024 11:20, Neil Armstrong wrote:
>>>>> This serie regroups all the fixes and base enhancements required to
>>>>> support the Qualcomm UFS controllers in U-Boot.
>>>>>
>>>>> This syncs headers & defines from Linux, and includes 2 set of
>>>>> fixes that were sent separately:
>>>>> - ufs: core: remove link_startup_again logic
>>>>> - ufs: properly fix cache operations
>>>>>
>>>>> Without those 2 sets, UFS cannot initialize on Qualcomm controlers
>>>>> since v5, and a numerous of Cache issues makes any UFS controller
>>>>> fail to initialize.
>>>>>
>>>>> Since UFS core hasn't changed for a while, and since UFS is core
>>>>> technology for the Qualcomm SoCs, I volunteer maintaininig the
>>>>> UFS subsystem if Bhupesh & Neha Malcom Francis are ok with that.
>>>>
>>>> Could you run this serie on the r8a779f0_spider, j721s2_evm_a72, j721e_evm_a72,
>>>> j7200_evm_a72, amd_versal2_virt and qemu-riscv and check for possible regressions ?
>>>>
>>>> It seems the only user of UFS_PCI is qemu-riscv, is there other users ?
>>>
>>>
>>> Good timing. We are close to send some updates to UFS which we require to get DWC version to work inside U-Boot.
>>>
>>> How far are that core changes from Linux? I see 9/13 is sync with Linux but when this is done you should also say which Linux version was used for sync.
>>
>> I think we are still quite far from Linux, we just took the basic required bits and pieces
>> to at least make the Qcom UFS controller driver build work, but Linux driver is overly complicated
>> with power management code we do not really need in U-Boot, so it's quite hard to sync honestly.
>>
>> But the plan is to align as much as possible once we get the basic Qcom UFS mainline.
> 
> That's understandable. But even when you say sync with Linux for some headers, etc it is good to say that it is sync with 6.11 for example.

Oh yes exact, I forgot to add this info, I planned to... I'll fix this in a v2.

Thanks,
Neil

> 
> Thanks,
> Michal
>
Neha Malcom Francis Sept. 19, 2024, 8:56 a.m. UTC | #7
Hi Neil

On 18/09/24 13:36, Neil Armstrong wrote:
> Hi Marek, Manorit, Tom, Michal,
> 
> On 10/09/2024 11:20, Neil Armstrong wrote:
>> This serie regroups all the fixes and base enhancements required to
>> support the Qualcomm UFS controllers in U-Boot.
>>
>> This syncs headers & defines from Linux, and includes 2 set of
>> fixes that were sent separately:
>> - ufs: core: remove link_startup_again logic
>> - ufs: properly fix cache operations
>>
>> Without those 2 sets, UFS cannot initialize on Qualcomm controlers
>> since v5, and a numerous of Cache issues makes any UFS controller
>> fail to initialize.
>>
>> Since UFS core hasn't changed for a while, and since UFS is core
>> technology for the Qualcomm SoCs, I volunteer maintaininig the
>> UFS subsystem if Bhupesh & Neha Malcom Francis are ok with that.
> 
> Could you run this serie on the r8a779f0_spider, j721s2_evm_a72, j721e_evm_a72,
> j7200_evm_a72, amd_versal2_virt and qemu-riscv and check for possible regressions ?
> 

For the K3 platforms (j721s2, j721e, j7200, j784s4) I have already done a sanity 
test with this series on j784s4 with no regressions seen, so should be fine.

> It seems the only user of UFS_PCI is qemu-riscv, is there other users ?
> 
> Thanks,
> Neil
> 
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>> ---
>> Bhupesh Sharma (5):
>>        ufs/ufs.h: Add definition of 'ufshcd_rmwl()'
>>        ufs: Clear UECPA once due to LINERESET has happened during LINK_STARTUP
>>        ufs: Sync possible UFS Quirks with Linux UFS driver
>>        ufs: Add missing memory barriers
>>        ufs: Fix debug message in 'ufs_start'
>>
>> Marek Vasut (2):
>>        ufs: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS
>>        ufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTO
>>
>> Neil Armstrong (6):
>>        ufs: allocate descriptors with size aligned with DMA_MINALIGN
>>        ufs: fix dcache flush and invalidate range calculation
>>        ufs: split flush and invalidate to only invalidate when required
>>        ufs: use dcache helpers for scsi_cmd data and only invalidate if necessary
>>        ufs: core: remove link_startup_again logic
>>        MAINTAINERS: Add myself to the list of UFS maintainers
>>
>>   MAINTAINERS       |   1 +
>>   drivers/ufs/ufs.c |  98 ++++++++++++++++++++--------------
>>   drivers/ufs/ufs.h | 157 +++++++++++++++++++++++++++++++++++++++++++++++-------
>>   3 files changed, 197 insertions(+), 59 deletions(-)
>> ---
>> base-commit: ca55cf8104c0dd78aae45fa66dd8400ef1b3d0ac
>> change-id: 20240910-topic-ufs-enhancements-fe8ef9ce39d8
>>
>> Best regards,
>
Abbarapu, Venkatesh Sept. 19, 2024, 9:21 a.m. UTC | #8
Hi,

> -----Original Message-----
> From: neil.armstrong@linaro.org <neil.armstrong@linaro.org>
> Sent: Thursday, September 19, 2024 1:22 PM
> To: Simek, Michal <michal.simek@amd.com>; Marek Vasut
> <marek.vasut+renesas@mailbox.org>; Neha Malcom Francis <n-francis@ti.com>;
> Manorit Chawdhry <m-chawdhry@ti.com>; Tom Rini <trini@konsulko.com>;
> bmeng.cn@gmail.com; Abbarapu, Venkatesh <venkatesh.abbarapu@amd.com>
> Cc: u-boot@lists.denx.de; u-boot-qcom@groups.io; Bhupesh Sharma
> <bhupesh.linux@gmail.com>
> Subject: Re: [PATCH 00/13] ufs: enhancements to support Qualcomm UFS
> controllers
> 
> On 18/09/2024 12:47, Michal Simek wrote:
> >
> >
> > On 9/18/24 12:40, neil.armstrong@linaro.org wrote:
> >> Hi,
> >>
> >> On 18/09/2024 11:03, Michal Simek wrote:
> >>> Hi Neil,
> >>>
> >>> On 9/18/24 10:06, Neil Armstrong wrote:
> >>>> Hi Marek, Manorit, Tom, Michal,
> >>>>
> >>>> On 10/09/2024 11:20, Neil Armstrong wrote:
> >>>>> This serie regroups all the fixes and base enhancements required
> >>>>> to support the Qualcomm UFS controllers in U-Boot.
> >>>>>
> >>>>> This syncs headers & defines from Linux, and includes 2 set of
> >>>>> fixes that were sent separately:
> >>>>> - ufs: core: remove link_startup_again logic
> >>>>> - ufs: properly fix cache operations
> >>>>>
> >>>>> Without those 2 sets, UFS cannot initialize on Qualcomm controlers
> >>>>> since v5, and a numerous of Cache issues makes any UFS controller
> >>>>> fail to initialize.
> >>>>>
> >>>>> Since UFS core hasn't changed for a while, and since UFS is core
> >>>>> technology for the Qualcomm SoCs, I volunteer maintaininig the UFS
> >>>>> subsystem if Bhupesh & Neha Malcom Francis are ok with that.
> >>>>
> >>>> Could you run this serie on the r8a779f0_spider, j721s2_evm_a72,
> >>>> j721e_evm_a72, j7200_evm_a72, amd_versal2_virt and qemu-riscv and
> check for possible regressions ?
> >>>>
> >>>> It seems the only user of UFS_PCI is qemu-riscv, is there other users ?
> >>>
> >>>
> >>> Good timing. We are close to send some updates to UFS which we require to
> get DWC version to work inside U-Boot.
> >>>
> >>> How far are that core changes from Linux? I see 9/13 is sync with Linux but
> when this is done you should also say which Linux version was used for sync.
> >>
> >> I think we are still quite far from Linux, we just took the basic
> >> required bits and pieces to at least make the Qcom UFS controller
> >> driver build work, but Linux driver is overly complicated with power management
> code we do not really need in U-Boot, so it's quite hard to sync honestly.
> >>
> >> But the plan is to align as much as possible once we get the basic Qcom UFS
> mainline.
> >
> > That's understandable. But even when you say sync with Linux for some headers,
> etc it is good to say that it is sync with 6.11 for example.
> 
> Oh yes exact, I forgot to add this info, I planned to... I'll fix this in a v2.
> 
> Thanks,
> Neil
> 
> >
> > Thanks,
> > Michal
> >
These changes are verified on AMD platform (amd_versal2_virt_defconfig) and no issues observed with this series.
Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>

Thanks
Venkatesh
Neil Armstrong Sept. 19, 2024, 11:47 a.m. UTC | #9
On 19/09/2024 11:21, Abbarapu, Venkatesh wrote:
> Hi,
> 
>> -----Original Message-----
>> From: neil.armstrong@linaro.org <neil.armstrong@linaro.org>
>> Sent: Thursday, September 19, 2024 1:22 PM
>> To: Simek, Michal <michal.simek@amd.com>; Marek Vasut
>> <marek.vasut+renesas@mailbox.org>; Neha Malcom Francis <n-francis@ti.com>;
>> Manorit Chawdhry <m-chawdhry@ti.com>; Tom Rini <trini@konsulko.com>;
>> bmeng.cn@gmail.com; Abbarapu, Venkatesh <venkatesh.abbarapu@amd.com>
>> Cc: u-boot@lists.denx.de; u-boot-qcom@groups.io; Bhupesh Sharma
>> <bhupesh.linux@gmail.com>
>> Subject: Re: [PATCH 00/13] ufs: enhancements to support Qualcomm UFS
>> controllers
>>
>> On 18/09/2024 12:47, Michal Simek wrote:
>>>
>>>
>>> On 9/18/24 12:40, neil.armstrong@linaro.org wrote:
>>>> Hi,
>>>>
>>>> On 18/09/2024 11:03, Michal Simek wrote:
>>>>> Hi Neil,
>>>>>
>>>>> On 9/18/24 10:06, Neil Armstrong wrote:
>>>>>> Hi Marek, Manorit, Tom, Michal,
>>>>>>
>>>>>> On 10/09/2024 11:20, Neil Armstrong wrote:
>>>>>>> This serie regroups all the fixes and base enhancements required
>>>>>>> to support the Qualcomm UFS controllers in U-Boot.
>>>>>>>
>>>>>>> This syncs headers & defines from Linux, and includes 2 set of
>>>>>>> fixes that were sent separately:
>>>>>>> - ufs: core: remove link_startup_again logic
>>>>>>> - ufs: properly fix cache operations
>>>>>>>
>>>>>>> Without those 2 sets, UFS cannot initialize on Qualcomm controlers
>>>>>>> since v5, and a numerous of Cache issues makes any UFS controller
>>>>>>> fail to initialize.
>>>>>>>
>>>>>>> Since UFS core hasn't changed for a while, and since UFS is core
>>>>>>> technology for the Qualcomm SoCs, I volunteer maintaininig the UFS
>>>>>>> subsystem if Bhupesh & Neha Malcom Francis are ok with that.
>>>>>>
>>>>>> Could you run this serie on the r8a779f0_spider, j721s2_evm_a72,
>>>>>> j721e_evm_a72, j7200_evm_a72, amd_versal2_virt and qemu-riscv and
>> check for possible regressions ?
>>>>>>
>>>>>> It seems the only user of UFS_PCI is qemu-riscv, is there other users ?
>>>>>
>>>>>
>>>>> Good timing. We are close to send some updates to UFS which we require to
>> get DWC version to work inside U-Boot.
>>>>>
>>>>> How far are that core changes from Linux? I see 9/13 is sync with Linux but
>> when this is done you should also say which Linux version was used for sync.
>>>>
>>>> I think we are still quite far from Linux, we just took the basic
>>>> required bits and pieces to at least make the Qcom UFS controller
>>>> driver build work, but Linux driver is overly complicated with power management
>> code we do not really need in U-Boot, so it's quite hard to sync honestly.
>>>>
>>>> But the plan is to align as much as possible once we get the basic Qcom UFS
>> mainline.
>>>
>>> That's understandable. But even when you say sync with Linux for some headers,
>> etc it is good to say that it is sync with 6.11 for example.
>>
>> Oh yes exact, I forgot to add this info, I planned to... I'll fix this in a v2.
>>
>> Thanks,
>> Neil
>>
>>>
>>> Thanks,
>>> Michal
>>>
> These changes are verified on AMD platform (amd_versal2_virt_defconfig) and no issues observed with this series.
> Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>

Great, thx for testing !

Neil

> 
> Thanks
> Venkatesh
>
Neil Armstrong Sept. 19, 2024, 11:48 a.m. UTC | #10
On 19/09/2024 10:56, Neha Malcom Francis wrote:
> Hi Neil
> 
> On 18/09/24 13:36, Neil Armstrong wrote:
>> Hi Marek, Manorit, Tom, Michal,
>>
>> On 10/09/2024 11:20, Neil Armstrong wrote:
>>> This serie regroups all the fixes and base enhancements required to
>>> support the Qualcomm UFS controllers in U-Boot.
>>>
>>> This syncs headers & defines from Linux, and includes 2 set of
>>> fixes that were sent separately:
>>> - ufs: core: remove link_startup_again logic
>>> - ufs: properly fix cache operations
>>>
>>> Without those 2 sets, UFS cannot initialize on Qualcomm controlers
>>> since v5, and a numerous of Cache issues makes any UFS controller
>>> fail to initialize.
>>>
>>> Since UFS core hasn't changed for a while, and since UFS is core
>>> technology for the Qualcomm SoCs, I volunteer maintaininig the
>>> UFS subsystem if Bhupesh & Neha Malcom Francis are ok with that.
>>
>> Could you run this serie on the r8a779f0_spider, j721s2_evm_a72, j721e_evm_a72,
>> j7200_evm_a72, amd_versal2_virt and qemu-riscv and check for possible regressions ?
>>
> 
> For the K3 platforms (j721s2, j721e, j7200, j784s4) I have already done a sanity test with this series on j784s4 with no regressions seen, so should be fine.

Ack, thanks for the report!

Neil

> 
>> It seems the only user of UFS_PCI is qemu-riscv, is there other users ?
>>
>> Thanks,
>> Neil
>>
>>>
>>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>>> ---
>>> Bhupesh Sharma (5):
>>>        ufs/ufs.h: Add definition of 'ufshcd_rmwl()'
>>>        ufs: Clear UECPA once due to LINERESET has happened during LINK_STARTUP
>>>        ufs: Sync possible UFS Quirks with Linux UFS driver
>>>        ufs: Add missing memory barriers
>>>        ufs: Fix debug message in 'ufs_start'
>>>
>>> Marek Vasut (2):
>>>        ufs: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS
>>>        ufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTO
>>>
>>> Neil Armstrong (6):
>>>        ufs: allocate descriptors with size aligned with DMA_MINALIGN
>>>        ufs: fix dcache flush and invalidate range calculation
>>>        ufs: split flush and invalidate to only invalidate when required
>>>        ufs: use dcache helpers for scsi_cmd data and only invalidate if necessary
>>>        ufs: core: remove link_startup_again logic
>>>        MAINTAINERS: Add myself to the list of UFS maintainers
>>>
>>>   MAINTAINERS       |   1 +
>>>   drivers/ufs/ufs.c |  98 ++++++++++++++++++++--------------
>>>   drivers/ufs/ufs.h | 157 +++++++++++++++++++++++++++++++++++++++++++++++-------
>>>   3 files changed, 197 insertions(+), 59 deletions(-)
>>> ---
>>> base-commit: ca55cf8104c0dd78aae45fa66dd8400ef1b3d0ac
>>> change-id: 20240910-topic-ufs-enhancements-fe8ef9ce39d8
>>>
>>> Best regards,
>>
>
Neil Armstrong Oct. 14, 2024, 6:56 a.m. UTC | #11
Hi,

On Tue, 10 Sep 2024 11:20:17 +0200, Neil Armstrong wrote:
> This serie regroups all the fixes and base enhancements required to
> support the Qualcomm UFS controllers in U-Boot.
> 
> This syncs headers & defines from Linux, and includes 2 set of
> fixes that were sent separately:
> - ufs: core: remove link_startup_again logic
> - ufs: properly fix cache operations
> 
> [...]

Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-ufs (u-boot-ufs-next)

[01/13] ufs: allocate descriptors with size aligned with DMA_MINALIGN
        https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/9c223d8d8b8fbad667971f36eabe203480a8c39b
[02/13] ufs: fix dcache flush and invalidate range calculation
        https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/c64d22b57d8a9fe4d08ab677ba33d6004b98a468
[03/13] ufs: split flush and invalidate to only invalidate when required
        https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/4139e5680bcf3016561c8830d914ee0b0ab741d1
[04/13] ufs: use dcache helpers for scsi_cmd data and only invalidate if necessary
        https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/589a7bf0febbe4d3ca319569a55f21cf06e85424
[05/13] ufs: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS
        https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/31f1615890b8c556d6f9d3c9cbed21378c782bcc
[06/13] ufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTO
        https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/03c6f9b6bfe7bab5710a33b56486fb9defe8ef50
[07/13] ufs/ufs.h: Add definition of 'ufshcd_rmwl()'
        https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/fdd33a7f140a2473277f9e365bc709f2cf425f0b
[08/13] ufs: Clear UECPA once due to LINERESET has happened during LINK_STARTUP
        https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/002afccdafdea6b6f0e4422e838649567b41e29d
[09/13] ufs: Sync possible UFS Quirks with Linux UFS driver
        https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/00c54af3addfc1475525396ec707c0c799010197
[10/13] ufs: Add missing memory barriers
        https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/5ce1a2c7de4936d19cbc0307be734aed9f8056a4
[11/13] ufs: Fix debug message in 'ufs_start'
        https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/966d3bf431273d8f397271026f0a6d488b3c87fc
[12/13] ufs: core: remove link_startup_again logic
        https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/67e291d147cd40c9b638515dc1bfa3c52d390959
[13/13] MAINTAINERS: Add myself to the list of UFS maintainers
        https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/fd6ce5a50d5b855559b9b7afc2dae73fd3f833c7