mbox series

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

Message ID 20240930-topic-ufs-enhancements-v3-0-58234f84ab89@linaro.org
Headers show
Series ufs: enhancements to support Qualcomm UFS controllers | expand

Message

Neil Armstrong Sept. 30, 2024, 12:44 p.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.

It has been reported to show regressions on:
- TI K3 platforms (j721s2, j721e, j7200, j784s4) [1]
- AMD platform (amd_versal2_virt_defconfig) [2]

[1] https://lore.kernel.org/all/38f599a8-7094-4a04-8ff6-96fc8b9d168a@ti.com/
[2] https://lore.kernel.org/all/SA1PR12MB869713CA620F99077B75EF0E98632@SA1PR12MB8697.namprd12.prod.outlook.com/

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Changes in v3:
- Fixup patch 9
- Link to v2: https://lore.kernel.org/r/20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org

Changes in v2:
- Added review and tested-by tags
- Updated patch 12 message with more explanations
- Synced patch 9 again with Linux 6.11
- Updated patches 7, 8, 9 and 10 with informations about the origins of the changes
- Link to v1: https://lore.kernel.org/r/20240910-topic-ufs-enhancements-v1-0-3ee0bffacc64@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 | 203 ++++++++++++++++++++++++++++++++++++++++++++++++------
 3 files changed, 241 insertions(+), 61 deletions(-)
---
base-commit: ddbcafeb53e7093c58488596bfce6d8823777c3a
change-id: 20240910-topic-ufs-enhancements-fe8ef9ce39d8

Best regards,

Comments

Neil Armstrong Oct. 7, 2024, 8:13 a.m. UTC | #1
Hi Bhupesh, Neha Malcom Francis,

On 30/09/2024 14:44, 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.
> 
> It has been reported to show regressions on:
> - TI K3 platforms (j721s2, j721e, j7200, j784s4) [1]
> - AMD platform (amd_versal2_virt_defconfig) [2]
> 
> [1] https://lore.kernel.org/all/38f599a8-7094-4a04-8ff6-96fc8b9d168a@ti.com/
> [2] https://lore.kernel.org/all/SA1PR12MB869713CA620F99077B75EF0E98632@SA1PR12MB8697.namprd12.prod.outlook.com/

Is it ok for me to apply the patches ?

Thanks,
Neil

> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
> Changes in v3:
> - Fixup patch 9
> - Link to v2: https://lore.kernel.org/r/20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org
> 
> Changes in v2:
> - Added review and tested-by tags
> - Updated patch 12 message with more explanations
> - Synced patch 9 again with Linux 6.11
> - Updated patches 7, 8, 9 and 10 with informations about the origins of the changes
> - Link to v1: https://lore.kernel.org/r/20240910-topic-ufs-enhancements-v1-0-3ee0bffacc64@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 | 203 ++++++++++++++++++++++++++++++++++++++++++++++++------
>   3 files changed, 241 insertions(+), 61 deletions(-)
> ---
> base-commit: ddbcafeb53e7093c58488596bfce6d8823777c3a
> change-id: 20240910-topic-ufs-enhancements-fe8ef9ce39d8
> 
> Best regards,
Neha Malcom Francis Oct. 7, 2024, 8:17 a.m. UTC | #2
Hi Neil

On 07/10/24 13:43, Neil Armstrong wrote:
> Hi Bhupesh, Neha Malcom Francis,
> 
> On 30/09/2024 14:44, 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.
>>
>> It has been reported to show regressions on:

Both of the links are saying that there are "no regressions" seen.

>> - TI K3 platforms (j721s2, j721e, j7200, j784s4) [1]
>> - AMD platform (amd_versal2_virt_defconfig) [2]
>>
>> [1] https://lore.kernel.org/all/38f599a8-7094-4a04-8ff6-96fc8b9d168a@ti.com/
>> [2] 
>> https://lore.kernel.org/all/SA1PR12MB869713CA620F99077B75EF0E98632@SA1PR12MB8697.namprd12.prod.outlook.com/
> 
> Is it ok for me to apply the patches ?
> 
> Thanks,
> Neil
> 
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>> ---
>> Changes in v3:
>> - Fixup patch 9
>> - Link to v2: 
>> https://lore.kernel.org/r/20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org
>>
>> Changes in v2:
>> - Added review and tested-by tags
>> - Updated patch 12 message with more explanations
>> - Synced patch 9 again with Linux 6.11
>> - Updated patches 7, 8, 9 and 10 with informations about the origins of the 
>> changes
>> - Link to v1: 
>> https://lore.kernel.org/r/20240910-topic-ufs-enhancements-v1-0-3ee0bffacc64@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 | 203 ++++++++++++++++++++++++++++++++++++++++++++++++------
>>   3 files changed, 241 insertions(+), 61 deletions(-)
>> ---
>> base-commit: ddbcafeb53e7093c58488596bfce6d8823777c3a
>> change-id: 20240910-topic-ufs-enhancements-fe8ef9ce39d8
>>
>> Best regards,
>
Neil Armstrong Oct. 7, 2024, 12:15 p.m. UTC | #3
On 07/10/2024 10:17, Neha Malcom Francis wrote:
> Hi Neil
> 
> On 07/10/24 13:43, Neil Armstrong wrote:
>> Hi Bhupesh, Neha Malcom Francis,
>>
>> On 30/09/2024 14:44, 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.
>>>
>>> It has been reported to show regressions on:
> 
> Both of the links are saying that there are "no regressions" seen.

Yes it's a typo, I was meaning "It has been reported to show no regressions on"

> 
>>> - TI K3 platforms (j721s2, j721e, j7200, j784s4) [1]
>>> - AMD platform (amd_versal2_virt_defconfig) [2]
>>>
>>> [1] https://lore.kernel.org/all/38f599a8-7094-4a04-8ff6-96fc8b9d168a@ti.com/
>>> [2] https://lore.kernel.org/all/SA1PR12MB869713CA620F99077B75EF0E98632@SA1PR12MB8697.namprd12.prod.outlook.com/
>>
>> Is it ok for me to apply the patches ?
>>
>> Thanks,
>> Neil
>>
>>>
>>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>>> ---
>>> Changes in v3:
>>> - Fixup patch 9
>>> - Link to v2: https://lore.kernel.org/r/20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org
>>>
>>> Changes in v2:
>>> - Added review and tested-by tags
>>> - Updated patch 12 message with more explanations
>>> - Synced patch 9 again with Linux 6.11
>>> - Updated patches 7, 8, 9 and 10 with informations about the origins of the changes
>>> - Link to v1: https://lore.kernel.org/r/20240910-topic-ufs-enhancements-v1-0-3ee0bffacc64@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 | 203 ++++++++++++++++++++++++++++++++++++++++++++++++------
>>>   3 files changed, 241 insertions(+), 61 deletions(-)
>>> ---
>>> base-commit: ddbcafeb53e7093c58488596bfce6d8823777c3a
>>> change-id: 20240910-topic-ufs-enhancements-fe8ef9ce39d8
>>>
>>> Best regards,
>>
>
Julius Lehmann Oct. 11, 2024, 6:10 p.m. UTC | #4
On 30.09.24 14:44, 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.
> 
> It has been reported to show regressions on:
> - TI K3 platforms (j721s2, j721e, j7200, j784s4) [1]
> - AMD platform (amd_versal2_virt_defconfig) [2]
> 
> [1] https://lore.kernel.org/all/38f599a8-7094-4a04-8ff6-96fc8b9d168a@ti.com/
> [2] https://lore.kernel.org/all/SA1PR12MB869713CA620F99077B75EF0E98632@SA1PR12MB8697.namprd12.prod.outlook.com/
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
> Changes in v3:
> - Fixup patch 9
> - Link to v2: https://lore.kernel.org/r/20240920-topic-ufs-enhancements-v2-0-65ae61e73eaa@linaro.org
> 
> Changes in v2:
> - Added review and tested-by tags
> - Updated patch 12 message with more explanations
> - Synced patch 9 again with Linux 6.11
> - Updated patches 7, 8, 9 and 10 with informations about the origins of the changes
> - Link to v1: https://lore.kernel.org/r/20240910-topic-ufs-enhancements-v1-0-3ee0bffacc64@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 | 203 ++++++++++++++++++++++++++++++++++++++++++++++++------
>   3 files changed, 241 insertions(+), 61 deletions(-)
> ---
> base-commit: ddbcafeb53e7093c58488596bfce6d8823777c3a
> change-id: 20240910-topic-ufs-enhancements-fe8ef9ce39d8
> 

tested the whole series in combination with 
https://lore.kernel.org/u-boot/20240910-topic-ufs-qcom-controller-v1-0-54c0d2231b10@linaro.org/ 
on a SM8150 tablet

Tested-by: Julius Lehmann <lehmanju@devpi.de>

> Best regards,
Neil Armstrong Oct. 14, 2024, 6:56 a.m. UTC | #5
Hi,

On Mon, 30 Sep 2024 14:44:22 +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