[PATCH 1/1] scsi: ufs: Allowing power mode change

2018-01-23 Thread Asutosh Das
From: Yaniv Gardi Due to M-PHY issues, moving from HS to any other mode or gear or even Hibern8 causes some un-predicted behavior of the device. This patch fixes this issues. Signed-off-by: Yaniv Gardi Signed-off-by: Subhash Jadavani Signed-off-by: Can Guo Signed-off-by: Asutosh Das

[PATCH 1/1] scsi: ufs: Enable quirk to ignore sending WRITE_SAME command

2018-01-23 Thread Asutosh Das
From: Sujit Reddy Thumma WRITE_SAME command is not supported by UFS. Enable a quirk for the upper level drivers to not send WRITE SAME command. Signed-off-by: Sujit Reddy Thumma Signed-off-by: Subhash Jadavani Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 3 +++ 1 file changed

[PATCH 1/1] scsi: ufs: Add LCC quirk for host and device

2018-01-25 Thread Asutosh Das
nt to disable the LCC on both host & device; hence this change splits the quirk in 2 parts one for host and one for device. Signed-off-by: Subhash Jadavani Signed-off-by: Venkat Gopalakrishnan Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufsh

[PATCH 1/1] scsi: ufs: fix exception event handling

2018-01-28 Thread Asutosh Das
timeout. Signed-off-by: Subhash Jadavani Signed-off-by: Maya Erez Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 8af2af3..2dd488f 100644 --- a

[PATCH 1/1] scsi: ufshcd: fix possible unclocked register access

2018-01-29 Thread Asutosh Das
enabled before vendor specific setup_clocks callback is called. Signed-off-by: Subhash Jadavani Signed-off-by: Venkat Gopalakrishnan Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 26 -- 1 file changed, 20 insertions(+), 6 deletions

[PATCH 1/1] scsi: ufs: add reference counting for scsi block requests

2018-01-29 Thread Asutosh Das
it to be unblocked only after #4. Though we may not have failures seen with this, we might run into some failures in future. Better solution would be to fix this by adding reference counting. Signed-off-by: Subhash Jadavani Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs

[PATCH 1/1] scsi: ufs-qcom: remove broken hci version quirk

2018-01-29 Thread Asutosh Das
From: Subhash Jadavani UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION is only applicable for QCOM UFS host controller version 2.x.y and this has been fixed from version 3.x.y onwards, hence this change removes this quirk for version 3.x.y onwards. Signed-off-by: Subhash Jadavani Signed-off-by: Asutosh

[PATCH 1/1] scsi: ufs: make sure all interrupts are processed

2018-01-29 Thread Asutosh Das
interrupt. Read the interrupt status in a loop after processing the received interrupt to catch such interrupts and handle it. Signed-off-by: Venkat Gopalakrishnan Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 27 +++ 1 file changed, 19 insertions(+), 8

[PATCH v1 9/9] scsi: ufs: enable FASTAUTO mode during low load condition

2018-07-06 Thread Asutosh Das
UFS device vendors. Signed-off-by: Subhash Jadavani Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 50588cf..a6e43f9 100644 --- a/drivers/scsi/ufs

Re: [RFC PATCH v3 1/1] scsi: ufs: Enable power management for wlun

2021-02-16 Thread Asutosh Das
On Sat, Feb 13 2021 at 13:37 -0800, Avri Altman wrote: + } else { Is it possible to get here? Scsi_scan_host is called only after successful add_wluns It looks so. scsi 0:0:0:49488: Link setup for lun - ufshcd_setup_links [...] Call trace: dump_backtrace+0x0/0x1d4 show_stack+0x18/0x24 du

Re: [RFC PATCH v3 1/1] scsi: ufs: Enable power management for wlun

2021-02-16 Thread Asutosh Das
On Fri, Feb 12 2021 at 19:25 -0800, Bart Van Assche wrote: On 2/11/21 11:18 AM, Asutosh Das wrote: +static inline bool is_rpmb_wlun(struct scsi_device *sdev) +{ + return (sdev->lun == ufshcd_upiu_wlun_to_scsi_wlun(UFS_UPIU_RPMB_WLUN)); +} + +static inline bool is_device_wlun(str

[PATCH v16 2/2] ufs: sysfs: Resume the proper scsi device

2021-04-07 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Reviewed-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers

[PATCH v16 1/2] scsi: ufs: Enable power management for wlun

2021-04-07 Thread Asutosh Das
a supplier for all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2

[PATCH v17 1/2] scsi: ufs: Enable power management for wlun

2021-04-08 Thread Asutosh Das
a supplier for all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2

[PATCH v17 2/2] ufs: sysfs: Resume the proper scsi device

2021-04-08 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Reviewed-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers

[RFC PATCH v3 1/1] scsi: ufs: Enable power management for wlun

2021-02-11 Thread Asutosh Das
all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 415 + drivers/scsi/ufs/ufshcd.h

[PATCH v4 1/2] scsi: ufs: Enable power management for wlun

2021-02-22 Thread Asutosh Das
all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 455 +++-- drivers/scsi/ufs/ufshcd.h

[PATCH v4 2/2] ufs: sysfs: Resume the proper scsi device

2021-02-22 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ufs/ufs-sysfs.c b

Re: [PATCH v4 1/2] scsi: ufs: Enable power management for wlun

2021-02-23 Thread Asutosh Das
On Tue, Feb 23 2021 at 12:23 -0800, Adrian Hunter wrote: On 23/02/21 1:04 am, Asutosh Das wrote: During runtime-suspend of ufs host, the scsi devices are already suspended and so are the queues associated with them. But the ufs host sends SSU to wlun during its runtime-suspend. During the

Re: [PATCH v4 1/2] scsi: ufs: Enable power management for wlun

2021-02-23 Thread Asutosh Das
On Tue, Feb 23 2021 at 12:23 -0800, Adrian Hunter wrote: On 23/02/21 1:04 am, Asutosh Das wrote: During runtime-suspend of ufs host, the scsi devices are already suspended and so are the queues associated with them. But the ufs host sends SSU to wlun during its runtime-suspend. During the

[PATCH v5 1/2] scsi: ufs: Enable power management for wlun

2021-02-23 Thread Asutosh Das
all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-qcom.c | 2 + drivers/scsi/ufs/ufshcd-pci.c| 24 -- drivers/scsi/ufs/ufshcd

[PATCH v5 2/2] ufs: sysfs: Resume the proper scsi device

2021-02-23 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ufs/ufs-sysfs.c b

Re: [PATCH v5 1/2] scsi: ufs: Enable power management for wlun

2021-02-24 Thread Asutosh Das
On Wed, Feb 24 2021 at 06:34 -0800, Adrian Hunter wrote: On 24/02/21 7:13 am, Asutosh Das wrote: During runtime-suspend of ufs host, the scsi devices are already suspended and so are the queues associated with them. But the ufs host sends SSU to wlun during its runtime-suspend. During the

[PATCH v6 2/2] ufs: sysfs: Resume the proper scsi device

2021-02-24 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ufs/ufs-sysfs.c b

[PATCH v6 1/2] scsi: ufs: Enable power management for wlun

2021-02-24 Thread Asutosh Das
all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2 + drivers/scsi/ufs/ufs

[PATCH v7 2/2] ufs: sysfs: Resume the proper scsi device

2021-02-24 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ufs/ufs-sysfs.c b

[PATCH v7 1/2] scsi: ufs: Enable power management for wlun

2021-02-24 Thread Asutosh Das
all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2 + drivers/scsi/ufs/ufs

Re: [RFC PATCH v3 1/1] scsi: ufs: Enable power management for wlun

2021-02-17 Thread Asutosh Das
On Tue, Feb 16 2021 at 09:44 -0800, Asutosh Das wrote: On Sat, Feb 13 2021 at 13:37 -0800, Avri Altman wrote: + } else { Is it possible to get here? Scsi_scan_host is called only after successful add_wluns It looks so. scsi 0:0:0:49488: Link setup for lun - ufshcd_setup_links

Re: [RFC PATCH v2 2/2] scsi: ufs: Fix deadlock while suspending ufs host

2021-01-28 Thread Asutosh Das
On Thu, Jan 28 2021 at 04:21 -0800, Avri Altman wrote: During runtime-suspend of ufs host, the scsi devices are already suspended and so are the queues associated with them. But the ufs host sends SSU to wlun during its runtime-suspend. Do you possible meant: "sends request-sense while clearing

Re: [PATCH v7 1/2] scsi: ufs: Enable power management for wlun

2021-02-25 Thread Asutosh Das
On Thu, Feb 25 2021 at 07:55 -0800, Adrian Hunter wrote: On 25/02/21 5:00 am, Asutosh Das wrote: During runtime-suspend of ufs host, the scsi devices are already suspended and so are the queues associated with them. But the ufs host sends SSU to wlun during its runtime-suspend. During the

[PATCH v8 1/2] scsi: ufs: Enable power management for wlun

2021-02-25 Thread Asutosh Das
all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2 + drivers/scsi/ufs/ufs

[PATCH v8 2/2] ufs: sysfs: Resume the proper scsi device

2021-02-25 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ufs/ufs-sysfs.c b

[PATCH v4 2/2] scsi: ufs-qcom: enter and exit hibern8 during clock scaling

2020-05-20 Thread Asutosh Das
Qualcomm controller needs to be in hibern8 before scaling clocks. This change puts the controller in hibern8 state before scaling and brings it out after scaling of clocks. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-qcom.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion

[PATCH v4 1/2] scsi: ufs: export hibern8 entry

2020-05-20 Thread Asutosh Das
Qualcomm controllers need to be in hibern8 before scaling up or down the clocks. Hence, export the hibern8 entry function. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 4 ++-- drivers/scsi/ufs/ufshcd.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers

Re: [PATCH] scsi: ufs: Remove an unpaired ufshcd_scsi_unblock_requests() in err_handler()

2020-08-17 Thread Asutosh Das
eturn path. Correct the coding mistake. Signed-off-by: Can Guo Reviewed-by: Asutosh Das diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 2b55c2e..b8441ad 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5670,7 +5670,6 @@ static void ufshcd_err_hand

[PATCH v13 2/2] ufs: sysfs: Resume the proper scsi device

2021-03-24 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Reviewed-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers

[PATCH v13 1/2] scsi: ufs: Enable power management for wlun

2021-03-24 Thread Asutosh Das
a supplier for all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2

[PATCH v12 2/2] ufs: sysfs: Resume the proper scsi device

2021-03-18 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Reviewed-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers

[PATCH v12 1/2] scsi: ufs: Enable power management for wlun

2021-03-18 Thread Asutosh Das
all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2 + drivers/scsi/ufs/ufs

Re: [PATCH v10 2/2] ufs: sysfs: Resume the proper scsi device

2021-03-04 Thread Asutosh Das
On Thu, Mar 04 2021 at 23:45 -0800, Adrian Hunter wrote: On 3/03/21 12:52 am, Asutosh Das wrote: Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Since "scsi: ufs: ufs-debugfs: Add user-defined exception_event_mask" is now in

[PATCH v14 2/2] ufs: sysfs: Resume the proper scsi device

2021-03-30 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Reviewed-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers

[PATCH v14 1/2] scsi: ufs: Enable power management for wlun

2021-03-30 Thread Asutosh Das
a supplier for all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2

[PATCH v10 1/2] scsi: ufs: Enable power management for wlun

2021-03-03 Thread Asutosh Das
all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2 + drivers/scsi/ufs/ufs

[PATCH v10 2/2] ufs: sysfs: Resume the proper scsi device

2021-03-03 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/ufs/ufs-sysfs.c b

[PATCH v19 2/2] ufs: sysfs: Resume the proper scsi device

2021-04-15 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Reviewed-by: Adrian Hunter Reviewed-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 24 1 file changed, 12 insertions(+), 12 deletions

[PATCH v19 1/2] scsi: ufs: Enable power management for wlun

2021-04-15 Thread Asutosh Das
suspend. Fixed smatch warnings: Reported-by: kernel test robot Reported-by: Dan Carpenter Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2 + drivers/scsi/ufs/ufs-debugfs.c

[PATCH v20 1/2] scsi: ufs: Enable power management for wlun

2021-04-16 Thread Asutosh Das
Carpenter Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2 + drivers/scsi/ufs/ufs-debugfs.c | 6 +- drivers/scsi/ufs/ufs-debugfs.h | 2 +- drivers/scsi/ufs/ufs

[PATCH v20 2/2] ufs: sysfs: Resume the proper scsi device

2021-04-16 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Reviewed-by: Adrian Hunter Reviewed-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 24 1 file changed, 12 insertions(+), 12 deletions

[PATCH v18 2/2] ufs: sysfs: Resume the proper scsi device

2021-04-14 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Reviewed-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/scsi

[PATCH v18 1/2] scsi: ufs: Enable power management for wlun

2021-04-14 Thread Asutosh Das
a supplier for all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2

[PATCH v15 1/2] scsi: ufs: Enable power management for wlun

2021-04-06 Thread Asutosh Das
a supplier for all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2

[PATCH v15 2/2] ufs: sysfs: Resume the proper scsi device

2021-04-06 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Reviewed-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers

Re: [RFC PATCH v3 1/1] scsi: ufs: Enable power management for wlun

2021-02-19 Thread Asutosh Das
On Fri, Feb 19 2021 at 00:35 -0800, Adrian Hunter wrote: On 11/02/21 9:18 pm, Asutosh Das wrote: During runtime-suspend of ufs host, the scsi devices are already suspended and so are the queues associated with them. But the ufs host sends SSU to wlun during its runtime-suspend. During the

Re: [PATCH v8 1/2] scsi: ufs: Enable power management for wlun

2021-03-01 Thread Asutosh Das
On Mon, Mar 01 2021 at 05:23 -0800, Adrian Hunter wrote: Hi A couple of minor things, but also a potential issue with when link state transitions are done. Please see comments below. On 26/02/21 1:37 am, Asutosh Das wrote: Hi Adrian Thanks for your comments. During runtime-suspend of ufs

[PATCH v11 2/2] ufs: sysfs: Resume the proper scsi device

2021-03-11 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/ufs/ufs-sysfs.c b

[PATCH v11 1/2] scsi: ufs: Enable power management for wlun

2021-03-11 Thread Asutosh Das
all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2 + drivers/scsi/ufs/ufs

Re: [PATCH] scsi: ufs: Fix incorrect ufshcd_state after ufshcd_reset_and_restore()

2021-03-01 Thread Asutosh Das
, ufshcd_reset_and_restore() will change the state to UFSHCD_STATE_ERROR, otherwise ufshcd_probe_hba() will have set the state appropriately. Fixes: 4db7a2360597 ("scsi: ufs: Fix concurrency of error handler and other error recovery paths") Signed-off-by: Adrian Hunter --- Reviewed-by: A

[PATCH v9 1/2] scsi: ufs: Enable power management for wlun

2021-03-01 Thread Asutosh Das
all other luns. That way, this device wlun suspends after all the consumers and resumes after hba resumes. Co-developed-by: Can Guo Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/cdns-pltfrm.c | 2 + drivers/scsi/ufs/tc-dwc-g210-pci.c | 2 + drivers/scsi/ufs/ufs

[PATCH v9 2/2] ufs: sysfs: Resume the proper scsi device

2021-03-01 Thread Asutosh Das
Resumes the actual scsi device the unit descriptor of which is being accessed instead of the hba alone. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-sysfs.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ufs/ufs-sysfs.c b

Re: [PATCH v9 1/2] scsi: ufs: Enable power management for wlun

2021-03-02 Thread Asutosh Das
On Tue, Mar 02 2021 at 06:14 -0800, Adrian Hunter wrote: On 2/03/21 5:21 am, Asutosh Das wrote: During runtime-suspend of ufs host, the scsi devices are already suspended and so are the queues associated with them. But the ufs host sends SSU to wlun during its runtime-suspend. During the

[RFC PATCH v1 1/2] block: bsg: resume scsi device before accessing

2021-01-26 Thread Asutosh Das
Resumes the scsi device before accessing it. Change-Id: I2929af60f2a92c89704a582fcdb285d35b429fde Signed-off-by: Asutosh Das Signed-off-by: Can Guo Signed-off-by: Bao D. Nguyen --- block/bsg.c | 8 1 file changed, 8 insertions(+) diff --git a/block/bsg.c b/block/bsg.c index d7bae94

[RFC PATCH v1 2/2] scsi: ufs: Fix deadlock while suspending ufs host

2021-01-26 Thread Asutosh Das
/0x18 Change-Id: Id777fd52493c8b5522d1ebcad73cd30dac33e8a4 Signed-off-by: Asutosh Das Signed-off-by: Can Guo Signed-off-by: Bao D. Nguyen --- drivers/scsi/ufs/ufshcd.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi

[RFC PATCH v2 1/2] block: bsg: resume platform device before accessing

2021-01-27 Thread Asutosh Das
It may happen that the underlying device's runtime-pm is not controlled by block-pm. So it's possible that when commands are sent to the device, it's suspended and may not be resumed by blk-pm. Hence explicitly resume the parent which is the platform device. Signed-off-by: Asutosh

[RFC PATCH v2 2/2] scsi: ufs: Fix deadlock while suspending ufs host

2021-01-27 Thread Asutosh Das
/0x18 Signed-off-by: Asutosh Das Signed-off-by: Can Guo Signed-off-by: Bao D. Nguyen --- drivers/scsi/ufs/ufshcd.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 9c691e4..b7e7f81 100644 --- a

[PATCH v1 1/2] scsi: ufs: export hibern8 entry and exit

2019-10-22 Thread Asutosh Das
Qualcomm controllers need to be in hibern8 before scaling up or down the clocks. Hence, export the hibern8 entry and exit functions. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 8 drivers/scsi/ufs/ufshcd.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff

[PATCH v1 2/2] scsi: ufs-qcom: enter and exit hibern8 during clock scaling

2019-10-22 Thread Asutosh Das
Qualcomm controller needs to be in hibern8 before scaling clocks. This change puts the controller in hibern8 state before scaling and brings it out after scaling of clocks. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-qcom.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers

[PATCH v2 2/2] scsi: ufs-qcom: enter and exit hibern8 during clock scaling

2019-10-23 Thread Asutosh Das
Qualcomm controller needs to be in hibern8 before scaling clocks. This change puts the controller in hibern8 state before scaling and brings it out after scaling of clocks. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-qcom.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers

[PATCH v2 1/2] scsi: ufs: export hibern8 entry and exit

2019-10-23 Thread Asutosh Das
Qualcomm controllers need to be in hibern8 before scaling up or down the clocks. Hence, export the hibern8 entry and exit functions. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 8 drivers/scsi/ufs/ufshcd.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff

[PATCH v3 2/2] scsi: ufs-qcom: enter and exit hibern8 during clock scaling

2019-10-23 Thread Asutosh Das
Qualcomm controller needs to be in hibern8 before scaling clocks. This change puts the controller in hibern8 state before scaling and brings it out after scaling of clocks. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-qcom.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion

[PATCH v3 1/2] scsi: ufs: export hibern8 entry and exit

2019-10-23 Thread Asutosh Das
Qualcomm controllers need to be in hibern8 before scaling up or down the clocks. Hence, export the hibern8 entry and exit functions. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 8 drivers/scsi/ufs/ufshcd.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff

[ 1/1] scsi: qcom-ufs: Add support for bus voting using ICB framework

2019-01-23 Thread Asutosh Das
peak bandwidth. Signed-off-by: Asutosh Das --- .../devicetree/bindings/ufs/ufshcd-pltfrm.txt | 12 ++ drivers/scsi/ufs/ufs-qcom.c| 234 - drivers/scsi/ufs/ufs-qcom.h| 20 ++ 3 files changed, 218 insertions(+), 48 deletions

[PATCH v2 05/10] scsi: ufshcd: fix possible unclocked register access

2018-05-03 Thread Asutosh Das
enabled before vendor specific setup_clocks callback is called. Signed-off-by: Subhash Jadavani Signed-off-by: Venkat Gopalakrishnan Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 26 -- 1 file changed, 20 insertions(+), 6 deletions

[PATCH v2 02/10] scsi: ufs-qcom: Enable UFSHCD_QUIRK_BROKEN_PWR_MODE_CHANGE quirk

2018-05-03 Thread Asutosh Das
Enable UFSHCD_QUIRK_BROKEN_PWR_MODE_CHANGE quirk to avoid failures in seen on some UFS devices. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 4563d2e

[PATCH v2 04/10] scsi: ufs: fix exception event handling

2018-05-03 Thread Asutosh Das
timeout. Signed-off-by: Subhash Jadavani Signed-off-by: Maya Erez Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 6dabce8..838ba8f0 100644 --- a

[PATCH v2 08/10] scsi: ufs: make sure all interrupts are processed

2018-05-03 Thread Asutosh Das
interrupt. Read the interrupt status in a loop after processing the received interrupt to catch such interrupts and handle it. Signed-off-by: Venkat Gopalakrishnan Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 27 +++ 1 file changed, 19 insertions(+), 8

[PATCH v2 07/10] scsi: ufs-qcom: remove broken hci version quirk

2018-05-03 Thread Asutosh Das
From: Subhash Jadavani UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION is only applicable for QCOM UFS host controller version 2.x.y and this has been fixed from version 3.x.y onwards, hence this change removes this quirk for version 3.x.y onwards. Signed-off-by: Subhash Jadavani Signed-off-by: Asutosh

[PATCH v2 06/10] scsi: ufs: add reference counting for scsi block requests

2018-05-03 Thread Asutosh Das
it to be unblocked only after #4. Though we may not have failures seen with this, we might run into some failures in future. Better solution would be to fix this by adding reference counting. Signed-off-by: Subhash Jadavani Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs

[PATCH v2 03/10] scsi: ufs: Add LCC quirk for host and device

2018-05-03 Thread Asutosh Das
both host & device; hence this change splits the quirk in 2 parts one for host and one for device. Signed-off-by: Subhash Jadavani Signed-off-by: Venkat Gopalakrishnan Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 16 drivers/scsi/ufs

[PATCH v2 09/10] scsi: ufs: fix irq return code

2018-05-03 Thread Asutosh Das
From: Venkat Gopalakrishnan Return IRQ_HANDLED only if the irq is really handled, this will help in catching spurious interrupts that go unhandled. Signed-off-by: Venkat Gopalakrishnan Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 137

[PATCH v2 01/10] scsi: ufs: Allowing power mode change

2018-05-03 Thread Asutosh Das
-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 8 +++- drivers/scsi/ufs/ufshcd.h | 7 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 5bc9dc1..f3083fe 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi

[PATCH v2 10/10] scsi: ufs: Add clock ungating to a separate workqueue

2018-05-03 Thread Asutosh Das
deadlock situation. So ungate work must be done in a separate work queue with WQ_MEM_RECLAIM flag enabled. Such a workqueue will have a rescue thread which will be called when the above deadlock condition is possible. Signed-off-by: Vijay Viswanath Signed-off-by: Can Guo Signed-off-by: Asutosh Das

Re: [PATCH v2 2/2] scsi: ufs: remove several redundant goto statements

2020-08-13 Thread Asutosh Das
On Wed, Aug 12 2020 at 07:37 -0700, Bean Huo wrote: From: Bean Huo Signed-off-by: Bean Huo --- drivers/scsi/ufs/ufshcd.c | 26 +- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index e3663b85e8ee..cd74

Re: [PATCH v2 1/2] scsi: ufs: change ufshcd_comp_devman_upiu() to ufshcd_compose_devman_upiu()

2020-08-13 Thread Asutosh Das
On Wed, Aug 12 2020 at 07:37 -0700, Bean Huo wrote: From: Bean Huo ufshcd_comp_devman_upiu() alwasy make me confuse that it is a request completion calling function. Change it to ufshcd_compose_devman_upiu(). Signed-off-by: Bean Huo Acked-by: Avri Altman Reviewed-by: Asutosh Das

Re: [PATCH v3 1/2] scsi: ufs: change ufshcd_comp_devman_upiu() to ufshcd_compose_devman_upiu()

2020-08-14 Thread Asutosh Das
On Fri, Aug 14 2020 at 02:50 -0700, Bean Huo wrote: From: Bean Huo ufshcd_comp_devman_upiu() alwasy make me confuse that it is a request completion calling function. Change it to ufshcd_compose_devman_upiu(). Signed-off-by: Bean Huo Acked-by: Avri Altman --- Reviewed-by: Asutosh Das

Re: [PATCH v3 2/2] scsi: ufs: remove several redundant goto statements

2020-08-14 Thread Asutosh Das
On Fri, Aug 14 2020 at 02:50 -0700, Bean Huo wrote: From: Bean Huo Signed-off-by: Bean Huo Reviewed-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 25 + 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs

[PATCH v2 1/2] scsi: ufs: Put hba into LPM during clk gating

2020-10-27 Thread Asutosh Das
From: Can Guo During clock gating, after clocks are disabled, put hba into LPM to save more power. Acked-by: Stanley Chu Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 9 +++-- drivers/scsi/ufs/ufshcd.h | 13 + 2 files changed, 20

[PATCH v2 2/2] ufs: qcom: Enable aggressive power collapse for ufs hba

2020-10-27 Thread Asutosh Das
Enabling this capability to let hba power-collapse more often to save power. Reviewed-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-qcom.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index f9d6ef3..9a19c6d

[PATCH v1 1/1] scsi: ufs: Keep UFS regulators on when autobkops enabled

2020-10-26 Thread Asutosh Das
D. Nguyen Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 47c544d..a94543c 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -8523

[PATCH v1 2/2] ufs: qcom: Enable aggressive power collapse for ufs hba

2020-10-26 Thread Asutosh Das
Enabling this capability to let hba power-collapse more often to save power. Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufs-qcom.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index f9d6ef3..9a19c6d 100644 --- a/drivers/scsi

[PATCH v1 1/2] scsi: ufs: Put hba into LPM during clk gating

2020-10-26 Thread Asutosh Das
From: Can Guo During clock gating, after clocks are disabled, put hba into LPM to save more power. Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 7 +-- drivers/scsi/ufs/ufshcd.h | 13 + 2 files changed, 18 insertions(+), 2 deletions

[PATCH 1/1] Documentation:sysfs-ufs: Add WriteBooster documentation

2020-06-09 Thread Asutosh Das
Adds sysfs documentation for WriteBooster entries. Signed-off-by: Asutosh Das --- Documentation/ABI/testing/sysfs-driver-ufs | 136 + 1 file changed, 136 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-driver-ufs b/Documentation/ABI/testing/sysfs-driver

[PATCH 7/9] scsi: ufs: make sure all interrupts are processed

2018-02-20 Thread Asutosh Das
interrupt. Read the interrupt status in a loop after processing the received interrupt to catch such interrupts and handle it. Signed-off-by: Venkat Gopalakrishnan Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 27 +++ 1 file changed, 19 insertions(+), 8

[PATCH 6/9] scsi: ufs-qcom: remove broken hci version quirk

2018-02-20 Thread Asutosh Das
From: Subhash Jadavani UFSHCD_QUIRK_BROKEN_UFS_HCI_VERSION is only applicable for QCOM UFS host controller version 2.x.y and this has been fixed from version 3.x.y onwards, hence this change removes this quirk for version 3.x.y onwards. Signed-off-by: Subhash Jadavani Signed-off-by: Asutosh

[PATCH 9/9] scsi: ufs: Add clock ungating to a separate workqueue

2018-02-20 Thread Asutosh Das
deadlock situation. So ungate work must be done in a separate work queue with WQ__RECLAIM flag enabled.Such a workqueue will have a rescue thread which will be called when the above deadlock condition is possible. Signed-off-by: Vijay Viswanath Signed-off-by: Can Guo Signed-off-by: Asutosh Das

[PATCH 4/9] scsi: ufshcd: fix possible unclocked register access

2018-02-20 Thread Asutosh Das
enabled before vendor specific setup_clocks callback is called. Signed-off-by: Subhash Jadavani Signed-off-by: Venkat Gopalakrishnan Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 26 -- 1 file changed, 20 insertions(+), 6 deletions

[PATCH 5/9] scsi: ufs: add reference counting for scsi block requests

2018-02-20 Thread Asutosh Das
it to be unblocked only after #4. Though we may not have failures seen with this, we might run into some failures in future. Better solution would be to fix this by adding reference counting. Signed-off-by: Subhash Jadavani Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs

[PATCH 2/9] scsi: ufs: Add LCC quirk for host and device

2018-02-20 Thread Asutosh Das
nt to disable the LCC on both host & device; hence this change splits the quirk in 2 parts one for host and one for device. Signed-off-by: Subhash Jadavani Signed-off-by: Venkat Gopalakrishnan Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufsh

[PATCH 8/9] scsi: ufs: fix irq return code

2018-02-20 Thread Asutosh Das
From: Venkat Gopalakrishnan Return IRQ_HANDLED only if the irq is really handled, this will help in catching spurious interrupts that go unhandled. Signed-off-by: Venkat Gopalakrishnan Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 137

[PATCH 1/9] scsi: ufs: Allowing power mode change

2018-02-20 Thread Asutosh Das
From: Yaniv Gardi Due to M-PHY issues, moving from HS to any other mode or gear or even Hibern8 causes some un-predicted behavior of the device. This patch fixes this issues. Signed-off-by: Yaniv Gardi Signed-off-by: Subhash Jadavani Signed-off-by: Can Guo Signed-off-by: Asutosh Das

[PATCH 3/9] scsi: ufs: fix exception event handling

2018-02-20 Thread Asutosh Das
timeout. Signed-off-by: Subhash Jadavani Signed-off-by: Maya Erez Signed-off-by: Can Guo Signed-off-by: Asutosh Das --- drivers/scsi/ufs/ufshcd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index cc7eb1e..8d3f8ce 100644 --- a

  1   2   >