[PATCH v5 0/3] scsi: ufs: Add error handling of Auto-Hibernate

2019-05-20 Thread Stanley Chu
Currently auto-hibernate is activated if host supports auto-hibern8 capability. However error-handling is not implemented, which makes the feature somewhat risky. If either "Hibernate Enter" or "Hibernate Exit" fail during auto-hibernate flow, the corresponding interrupt "UIC_HIBERNATE_ENTER" or "

[PATCH v5 1/3] scsi: ufs: Introduce ufshcd_is_auto_hibern8_supported()

2019-05-20 Thread Stanley Chu
The checking of Auto-Hibernation support is used in many places in the driver, thus re-factor it as ufshcd_is_auto_hibern8_supported() to make code more clean. Signed-off-by: Stanley Chu Reviewed-by: Bean Huo Reviewed-by: Alim Akhtar --- drivers/scsi/ufs/ufs-sysfs.c | 6 +++--- drivers/scsi/uf

[PATCH v5 3/3] scsi: ufs: Add error-handling of Auto-Hibernate

2019-05-20 Thread Stanley Chu
Currently auto-hibernate is activated if host supports auto-hibern8 capability. However error-handling is not implemented, which makes the feature somewhat risky. If either "Hibernate Enter" or "Hibernate Exit" fail during auto-hibernate flow, the corresponding interrupt "UIC_HIBERNATE_ENTER" or "

[PATCH v5 2/3] scsi: ufs: Do not overwrite Auto-Hibernate timer

2019-05-20 Thread Stanley Chu
Some vendor-specific initialization flow may set its own auto-hibernate timer. In this case, do not overwrite timer value as "default value" in ufshcd_init(). Signed-off-by: Stanley Chu Reviewed-by: Alim Akhtar --- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

RE: [PATCH v4 2/3] scsi: ufs: Introduce ufshcd_is_auto_hibern8_supported()

2019-05-20 Thread Stanley Chu
Hi Avri, On Tue, 2019-05-21 at 06:18 +, Avri Altman wrote: > > > > ufshcd_is_auto_hibern8_supported() will be used elsewhere > > in the driver, thus refactor it for preparation. > You missed a couple of spots, e.g. in ufshcd_auto_hibern8_enable and in > ufs-sysfs. Yes... Will re-factor them

RE: [PATCH v4 2/3] scsi: ufs: Introduce ufshcd_is_auto_hibern8_supported()

2019-05-20 Thread Avri Altman
> > ufshcd_is_auto_hibern8_supported() will be used elsewhere > in the driver, thus refactor it for preparation. You missed a couple of spots, e.g. in ufshcd_auto_hibern8_enable and in ufs-sysfs. Thanks, Avri

[PATCH v4 1/3] scsi: ufs: Do not overwrite Auto-Hibernate timer

2019-05-20 Thread Stanley Chu
Some vendor-specific initialization flow may set its own auto-hibernate timer. In this case, do not overwrite timer value as "default value" in ufshcd_init(). Signed-off-by: Stanley Chu Reviewed-by: Alim Akhtar --- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v4 0/3] scsi: ufs: Add error handling of Auto-Hibernate

2019-05-20 Thread Stanley Chu
Currently auto-hibernate is activated if host supports auto-hibern8 capability. However error-handling is not implemented, which makes the feature somewhat risky. If either "Hibernate Enter" or "Hibernate Exit" fail during auto-hibernate flow, the corresponding interrupt "UIC_HIBERNATE_ENTER" or "

[PATCH v4 3/3] scsi: ufs: Add error-handling of Auto-Hibernate

2019-05-20 Thread Stanley Chu
Currently auto-hibernate is activated if host supports auto-hibern8 capability. However error-handling is not implemented, which makes the feature somewhat risky. If either "Hibernate Enter" or "Hibernate Exit" fail during auto-hibernate flow, the corresponding interrupt "UIC_HIBERNATE_ENTER" or "

[PATCH v4 2/3] scsi: ufs: Introduce ufshcd_is_auto_hibern8_supported()

2019-05-20 Thread Stanley Chu
ufshcd_is_auto_hibern8_supported() will be used elsewhere in the driver, thus refactor it for preparation. Signed-off-by: Stanley Chu Reviewed-by: Bean Huo Reviewed-by: Alim Akhtar --- drivers/scsi/ufs/ufshcd.c | 2 +- drivers/scsi/ufs/ufshcd.h | 5 + 2 files changed, 6 insertions(+), 1 de

RE: [PATCH v3 2/3] scsi: ufs: Add error-handling of Auto-Hibernate

2019-05-20 Thread Stanley Chu
Hi Avri, On Mon, 2019-05-20 at 09:51 +, Avri Altman wrote: > Aside from some nits - see below, looks fine. > > Thanks, > Avri > > > diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h > > index ecfa898b9ccc..994d73d03207 100644 > > --- a/drivers/scsi/ufs/ufshcd.h > > +++ b/dri

[PATCH v2 00/10] mpt3sas: Aero/Sea HBA feature addition

2019-05-20 Thread Suganath Prabu S
From: Suganath Prabu In this patch series we are adding below two features for Aero/Sea HBA device. Aero/Sea series HBA is PCI4.0 based controllers. 1. Add Atomic Request descriptor support: Atomic Request Descriptor is an alternative method for posting an entry onto a request queue. The posting

[PATCH v2 10/10] mpt3sas: Update driver version to 29.100.00.00

2019-05-20 Thread Suganath Prabu S
From: Suganath Prabu Update driver version from 28.100.00.00 to 29.100.00.00 This is equivalent to Phase 10 OOB driver. Signed-off-by: Suganath Prabu --- drivers/scsi/mpt3sas/mpt3sas_base.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_bas

[PATCH v2 06/10] mpt3sas:save msix index and use same while posting RD

2019-05-20 Thread Suganath Prabu S
From: Suganath Prabu Code refactor: In the IO submission path _base_get_msix_index is called twice, one while getting the smid; msix index is saved in msix_io filed in scsiio tracker and anther while posting the request descriptor(RD). now code refactor is done to determine msix index only while

[PATCH v2 09/10] mpt3sas: Introduce perf_mode module parameter

2019-05-20 Thread Suganath Prabu S
From: Suganath Prabu 1. Introduce module parameter perf_mode for only Aero/Sea generation HBAs. 2. Update IOC page1 fields according to performance mode. Below are the performance modes that can be enabled with module parameter perf_mode. 0: Balanced - Few high iops reply queues will be enab

[PATCH v2 07/10] mpt3sas: Affinity high iops queues IRQs to local node

2019-05-20 Thread Suganath Prabu S
From: Suganath Prabu High iops queues are mapped to non-managed irqs. Set affinity of non-managed irqs to local numa node. Low latency queues are mapped to managed irq. Driver reserves some reply queues (pci_alloc_irq_vectors_affinity and .pre_vectors interface is used to meet the goal) for max

[PATCH v2 04/10] mpt3sas: change _base_get_msix_index prototype

2019-05-20 Thread Suganath Prabu S
From: Suganath Prabu Code refactoring. In function _base_get_msix_index add scmd as second argument. This change is required for creating function pointer in next patch, where we introduce new function to get the msix index for high iops queues Signed-off-by: Suganath Prabu --- drivers/scsi/m

[PATCH v2 03/10] mpt3sas: Add flag high_iops_queues

2019-05-20 Thread Suganath Prabu S
From: Suganath Prabu Aero controllers supports balanced performance mode and driver enables set of high iops and low latency reply queue only if, - HBA is an AERO controller, - MSIXs vector supported by the HBA is 128, - Total CPU count in the system more than high iops queue count, - Loaded

[PATCH v2 08/10] mpt3sas: Enable interrupt coalescing on high iops

2019-05-20 Thread Suganath Prabu S
From: Suganath Prabu Enable interrupt coalescing only on high iops queues when high iops queues are enabled. In ioc config page 1, offset 0x14 (ProductSpecific field) is used to determine interrupt coalescing enabled/disabled on per reply descriptor post queue group(8) basis. If 31st bit is zero

[PATCH v2 02/10] mpt3sas: Add Atomic RequestDescriptor support on Aero

2019-05-20 Thread Suganath Prabu S
From: Suganath Prabu If the Aero HBA supports Atomic Request Descriptors, it sets the Atomic Request Descriptor Capable bit in the IOCCapabilities field of the IOCFacts Reply message. Driver uses an Atomic Request Descriptor as an alternative method for posting an entry onto a request queue. The

[PATCH v2 05/10] mpt3sas: Use highiops queues if more in-flights

2019-05-20 Thread Suganath Prabu S
From: Suganath Prabu Driver will use round robin method for io submission in batches within the high iops queues when in-flight ios on the target device is more than 8. If in-flight ios per SCSI device more than 8, driver will use high iops queue else driver will use low latency reply queues. S

[PATCH v2 01/10] mpt3sas: function pointers of request descriptor

2019-05-20 Thread Suganath Prabu S
From: Suganath Prabu This code refactoring introduces function pointers. Host uses Request Descriptors of different types for posting an entry onto a request queue. Based on controller type and capabilities, host can also use atomic descriptors other than normal descriptors. Using function point

RE: [PATCH v3 2/3] scsi: ufs: Add error-handling of Auto-Hibernate

2019-05-20 Thread Avri Altman
Aside from some nits - see below, looks fine. Thanks, Avri > diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h > index ecfa898b9ccc..994d73d03207 100644 > --- a/drivers/scsi/ufs/ufshcd.h > +++ b/drivers/scsi/ufs/ufshcd.h > @@ -740,6 +740,11 @@ return true; > #endif > } > > +st

[PATCH v3 0/3] scsi: ufs: Add error handling of Auto-Hibernate

2019-05-20 Thread Stanley Chu
Currently auto-hibernate is activated if host supports auto-hibern8 capability. However error-handling is not implemented, which makes the feature somewhat risky. If either "Hibernate Enter" or "Hibernate Exit" fail during auto-hibernate flow, the corresponding interrupt "UIC_HIBERNATE_ENTER" or "

[PATCH v3 1/3] scsi: ufs: Do not overwrite Auto-Hibernate timer

2019-05-20 Thread Stanley Chu
Some vendor-specific initialization flow may set its own auto-hibernate timer. In this case, do not overwrite timer value as "default value" in ufshcd_init(). Signed-off-by: Stanley Chu Reviewed-by: Alim Akhtar --- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v3 2/3] scsi: ufs: Add error-handling of Auto-Hibernate

2019-05-20 Thread Stanley Chu
Currently auto-hibernate is activated if host supports auto-hibern8 capability. However error-handling is not implemented, which makes the feature somewhat risky. If either "Hibernate Enter" or "Hibernate Exit" fail during auto-hibernate flow, the corresponding interrupt "UIC_HIBERNATE_ENTER" or "

[PATCH v3 3/3] scsi: ufs: Use re-factored Auto-Hibernate function

2019-05-20 Thread Stanley Chu
Use re-factored ufshcd_is_auto_hibern8_supported() function in ufshcd_init() instead to make code more cleaner. Signed-off-by: Stanley Chu Reviewed-by: Bean Huo Reviewed-by: Alim Akhtar --- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/sc