mbox series

[v3,0/8] Use UFS device indicated maximum LU number

Message ID 20200119001327.29155-1-huobean@gmail.com (mailing list archive)
Headers show
Series Use UFS device indicated maximum LU number | expand

Message

Bean Huo Jan. 19, 2020, 12:13 a.m. UTC
This series of patches is to simplify UFS driver initialization flow
and add a new parameter max_lu_supported used to specify how many LUs 
supported by the UFS device.
This series of patches being tested on my two platforms, Qualcomm SOC 
based and Hisilicon SOC based platforms.

v1-v2:
    1. Split ufshcd_probe_hba() based on its called flow                                                                                                                                                   
    2. Delete two unnecessary functions
    3. Add a fixup patch
v2-v3:
    1. Combine patches 7/9 and 8/9 of v2 to patch 7/8 of v3
    2. Change patches 1/8 and 5/8 subject
    3. Change the name of two functions in patch 7/8

Bean Huo (8):
  scsi: ufs: Fix ufshcd_probe_hba() reture value in case
    ufshcd_scsi_add_wlus() fails
  scsi: ufs: Delete struct ufs_dev_desc
  scsi: ufs: Split ufshcd_probe_hba() based on its called flow
  scsi: ufs: move ufshcd_get_max_pwr_mode() to ufs_init_params()
  scsi: ufs: Inline two functions into their callers
  scsi: ufs: Delete is_init_prefetch from struct ufs_hba
  scsi: ufs: Add max_lu_supported in struct ufs_dev_info
  scsi: ufs: Use UFS device indicated maximum LU number

 drivers/scsi/ufs/ufs-mediatek.c |   7 +-
 drivers/scsi/ufs/ufs-qcom.c     |   6 +-
 drivers/scsi/ufs/ufs-sysfs.c    |   2 +-
 drivers/scsi/ufs/ufs.h          |  25 ++-
 drivers/scsi/ufs/ufs_quirks.h   |   9 +-
 drivers/scsi/ufs/ufshcd.c       | 276 +++++++++++++++++++-------------
 drivers/scsi/ufs/ufshcd.h       |   9 +-
 7 files changed, 196 insertions(+), 138 deletions(-)

Comments

Alim Akhtar Jan. 19, 2020, 4:39 a.m. UTC | #1
Hi Bean

Your patches based on which tree? At least on Jame's for-next, it give
compilation errors.
(git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git)
Looks like patch-2 introduces below error:
========
drivers/scsi/ufs/ufs-qcom.c: In function ‘ufs_qcom_apply_dev_quirks’:
drivers/scsi/ufs/ufs-qcom.c:955:34: error: incompatible types when
initializing type ‘struct ufs_dev_info *’ using type ‘struct
ufs_dev_info’
  struct ufs_dev_info *dev_info = hba->dev_info;
                                  ^~~
drivers/scsi/ufs/ufs-qcom.c:957:14: error: ‘struct ufs_dev_info’ has
no member named ‘dev_quirks’
  if (dev_info->dev_quirks & UFS_DEVICE_QUIRK_HOST_PA_SAVECONFIGTIME)
              ^~
scripts/Makefile.build:265: recipe for target
'drivers/scsi/ufs/ufs-qcom.o' failed
make[3]: *** [drivers/scsi/ufs/ufs-qcom.o] Error 1
=========


On Sun, Jan 19, 2020 at 5:44 AM Bean Huo <huobean@gmail.com> wrote:
>
> This series of patches is to simplify UFS driver initialization flow
> and add a new parameter max_lu_supported used to specify how many LUs
> supported by the UFS device.
> This series of patches being tested on my two platforms, Qualcomm SOC
> based and Hisilicon SOC based platforms.
>
> v1-v2:
>     1. Split ufshcd_probe_hba() based on its called flow
>     2. Delete two unnecessary functions
>     3. Add a fixup patch
> v2-v3:
>     1. Combine patches 7/9 and 8/9 of v2 to patch 7/8 of v3
>     2. Change patches 1/8 and 5/8 subject
>     3. Change the name of two functions in patch 7/8
>
> Bean Huo (8):
>   scsi: ufs: Fix ufshcd_probe_hba() reture value in case
>     ufshcd_scsi_add_wlus() fails
>   scsi: ufs: Delete struct ufs_dev_desc
>   scsi: ufs: Split ufshcd_probe_hba() based on its called flow
>   scsi: ufs: move ufshcd_get_max_pwr_mode() to ufs_init_params()
>   scsi: ufs: Inline two functions into their callers
>   scsi: ufs: Delete is_init_prefetch from struct ufs_hba
>   scsi: ufs: Add max_lu_supported in struct ufs_dev_info
>   scsi: ufs: Use UFS device indicated maximum LU number
>
>  drivers/scsi/ufs/ufs-mediatek.c |   7 +-
>  drivers/scsi/ufs/ufs-qcom.c     |   6 +-
>  drivers/scsi/ufs/ufs-sysfs.c    |   2 +-
>  drivers/scsi/ufs/ufs.h          |  25 ++-
>  drivers/scsi/ufs/ufs_quirks.h   |   9 +-
>  drivers/scsi/ufs/ufshcd.c       | 276 +++++++++++++++++++-------------
>  drivers/scsi/ufs/ufshcd.h       |   9 +-
>  7 files changed, 196 insertions(+), 138 deletions(-)
>
> --
> 2.17.1
>
Bean Huo Jan. 19, 2020, 9:59 p.m. UTC | #2
Hi, Alim

> 
> Hi Bean
> 
> Your patches based on which tree? At least on Jame's for-next, it give
> compilation errors.
> (git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git)
> Looks like patch-2 introduces below error:

My patches are based on the Martin's tree 5.6/scsi-queue. I tested my patches on James' tree.
Didn't find the compilation error as you mentioned.  You can check your source code if it is pretty new,
The last UFS driver updated commit id should be :


commit ea92c32bd336efba89c5b09cf609e6e26e963796
Author: Stanley Chu <stanley.chu@mediatek.com>
Date:   Sat Jan 11 15:11:47 2020 +0800

 scsi: ufs-mediatek: add apply_dev_quirks variant operation

 Add vendor-specific variant callback "apply_dev_quirks" to MediaTek UFS driver.


Thanks,

//Bean
Alim Akhtar Jan. 20, 2020, 3:25 a.m. UTC | #3
On Mon, Jan 20, 2020 at 3:29 AM Bean Huo (beanhuo) <beanhuo@micron.com> wrote:
>
> Hi, Alim
>
> >
> > Hi Bean
> >
> > Your patches based on which tree? At least on Jame's for-next, it give
> > compilation errors.
> > (git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git)
> > Looks like patch-2 introduces below error:
>
> My patches are based on the Martin's tree 5.6/scsi-queue. I tested my patches on James' tree.
> Didn't find the compilation error as you mentioned.  You can check your source code if it is pretty new,
> The last UFS driver updated commit id should be :
>
>
> commit ea92c32bd336efba89c5b09cf609e6e26e963796
> Author: Stanley Chu <stanley.chu@mediatek.com>
> Date:   Sat Jan 11 15:11:47 2020 +0800
>
>  scsi: ufs-mediatek: add apply_dev_quirks variant operation
>
>  Add vendor-specific variant callback "apply_dev_quirks" to MediaTek UFS driver.
>
Thanks Bean for letting me know about this.
Unfortunately, I still see the error (with enabled MKT and QCOM driver
in defconfig)
===================
drivers/scsi/ufs/ufs-mediatek.c: In function ‘ufs_mtk_apply_dev_quirks’:
drivers/scsi/ufs/ufs-mediatek.c:411:34: error: incompatible types when
initializing type ‘struct ufs_dev_info *’ using type ‘struct
ufs_dev_info’
  struct ufs_dev_info *dev_info = hba->dev_info;
                                  ^~~
scripts/Makefile.build:265: recipe for target
'drivers/scsi/ufs/ufs-mediatek.o' failed
make[3]: *** [drivers/scsi/ufs/ufs-mediatek.o] Error 1
make[3]: *** Waiting for unfinished jobs....
drivers/scsi/ufs/ufs-qcom.c: In function ‘ufs_qcom_apply_dev_quirks’:
drivers/scsi/ufs/ufs-qcom.c:955:34: error: incompatible types when
initializing type ‘struct ufs_dev_info *’ using type ‘struct
ufs_dev_info’
  struct ufs_dev_info *dev_info = hba->dev_info;
                                  ^~~
drivers/scsi/ufs/ufs-qcom.c:957:14: error: ‘struct ufs_dev_info’ has
no member named ‘dev_quirks’
  if (dev_info->dev_quirks & UFS_DEVICE_QUIRK_HOST_PA_SAVECONFIGTIME)
              ^~
scripts/Makefile.build:265: recipe for target
'drivers/scsi/ufs/ufs-qcom.o' failed
======
git log --oneline on the tree looks like below:

7b700f8ec213 (HEAD -> local-martin-5.6-scsi-queue) scsi: ufs: Use UFS
device indicated maximum LU number
be7a1644f3af scsi: ufs: Add max_lu_supported in struct ufs_dev_info
13cd5c519941 scsi: ufs: Delete is_init_prefetch from struct ufs_hba
27539cb1d81d scsi: ufs: Inline two functions into their callers
cbe20395fe01 scsi: ufs: move ufshcd_get_max_pwr_mode() to ufs_init_params()
9fb0c168ef38 scsi: ufs: Split ufshcd_probe_hba() based on its called flow
a5d0e0fbd4d0 scsi: ufs: Delete struct ufs_dev_desc
c2aa6b365857 scsi: ufs: Fix ufshcd_probe_hba() reture value in case
ufshcd_scsi_add_wlus() fails
824b72db5086 (tag: mkp-scsi-queue, scsi/misc, martin-scsi/queue,
martin-scsi/5.6/scsi-queue) scsi: megaraid_sas: Update driver version
to 07.713.01.00-rc1
4d1634b8d12e scsi: megaraid_sas: Use Block layer API to check SCSI
device in-flight IO requests
56ee0c585602 scsi: megaraid_sas: Limit the number of retries for the
IOCTLs causing firmware fault
6d7537270e32 scsi: megaraid_sas: Do not initiate OCR if controller is
not in ready state
=====

~/work/linux (local-martin-5.6-scsi-queue) $ git log --oneline
drivers/scsi/ufs/ufs-mediatek.c
a5d0e0fbd4d0 scsi: ufs: Delete struct ufs_dev_desc
ea92c32bd336 scsi: ufs-mediatek: add apply_dev_quirks variant operation
5d74e18edd7b scsi: ufs-mediatek: configure and enable clk-gating

========
~/work/linux (local-martin-5.6-scsi-queue) $ git log --oneline
drivers/scsi/ufs/ufs-mediatek.c
a5d0e0fbd4d0 scsi: ufs: Delete struct ufs_dev_desc
ea92c32bd336 scsi: ufs-mediatek: add apply_dev_quirks variant operation
5d74e18edd7b scsi: ufs-mediatek: configure and enable clk-gating

Which has the mentioned commit by you.
=======

I am on gcc: aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0

Am I missed any patches which is needed?

>
> Thanks,
>
> //Bean
Bean Huo Jan. 20, 2020, 1:12 p.m. UTC | #4
Hi, Alim

> I am on gcc: aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1)
> 7.4.0
> 
> Am I missed any patches which is needed?

You didn't miss any patch, It is my fault, I have fixed it in my new version. You can check now.
Thanks,

//Bean