[PATCH v2 22/30] cxlflash: Correct behavior in device reset handler following EEH

2015-09-16 Thread Matthew R. Ochs
the TMF was not sent. To fix, the state is rechecked after coming out of the reset state. When the state is normal, a TMF will be sent out. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by: Brian King --- drivers/scsi/cxlflash/main.c | 5 ++--- 1 file changed, 2

[PATCH v2 27/30] cxlflash: Correct spelling, grammar, and alignment mistakes

2015-09-16 Thread Matthew R. Ochs
consistency. Remove extra lines and a few unneeded variables/statements. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h| 2 -- drivers/scsi/cxlflash/main.c | 62 +-- drivers/scsi/cxlflash/sislite.h

[PATCH v2 21/30] cxlflash: Fix to prevent workq from accessing freed memory

2015-09-16 Thread Matthew R. Ochs
there is not a need to process any scheduled work when shutting down. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c

[PATCH v2 20/30] cxlflash: Correct usage of scsi_host_put()

2015-09-16 Thread Matthew R. Ochs
remove to be the last cleanup action taken and introduce a call to scsi_host_put() in the one initialization error path that does not use remove to cleanup. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH v2 25/30] cxlflash: Fix MMIO and endianness errors

2015-09-16 Thread Matthew R. Ochs
Sparse uncovered several errors with MMIO operations (accessing directly) and handling endianness. These can cause issues when running in different environments. Introduce __iomem and proper endianness tags/swaps where appropriate to make driver sparse clean. Signed-off-by: Matthew R. Ochs

[PATCH v2 26/30] cxlflash: Fix to prevent EEH recovery failure

2015-09-16 Thread Matthew R. Ochs
ntext mutex is reacquired and the context is made available again. The context can be safely moved to the error state if needed during the unavailable window as no other threads will hold its reference. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superp

[PATCH v2 17/30] cxlflash: Fix async interrupt bypass logic

2015-09-16 Thread Matthew R. Ochs
: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index 39ad7a3..74eb742 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash

[PATCH v2 18/30] cxlflash: Remove dual port online dependency

2015-09-16 Thread Matthew R. Ochs
R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 23 --- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index 74eb742..e2cc410 100644 --- a/drivers/scsi/cxlflash/main.c +++ b

[PATCH v2 19/30] cxlflash: Fix AFU version access/storage and add check

2015-09-16 Thread Matthew R. Ochs
-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h | 2 +- drivers/scsi/cxlflash/main.c| 18 -- drivers/scsi/cxlflash/sislite.h | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/cxlflash/common.h b

[PATCH v2 16/30] cxlflash: Fix host link up event handling

2015-09-16 Thread Matthew R. Ochs
-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h | 2 +- drivers/scsi/cxlflash/main.c | 17 + drivers/scsi/cxlflash/main.h | 1 + 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi

[PATCH v2 13/30] cxlflash: Fix to avoid spamming the kernel log

2015-09-16 Thread Matthew R. Ochs
- pr_debug to pr_debug_ratelimited - pr_err to dev_err - pr_debug to dev_dbg Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 105 --- 1 file changed, 58 insertions(+), 47 deletions(-) diff --git a/drivers

[PATCH v2 14/30] cxlflash: Fix to avoid stall while waiting on TMF

2015-09-16 Thread Matthew R. Ochs
such that a bigger hammer reset can occur. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h | 1 + drivers/scsi/cxlflash/main.c | 55 +- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/dr

[PATCH v2 15/30] cxlflash: Fix location of setting resid

2015-09-16 Thread Matthew R. Ochs
The resid is incorrectly set which can lead to unnecessary retry attempts by the stack. This is due to resid _always_ being set using a value returned from the adapter. Instead, the value should only be interpreted and set when in an underrun scenario. Signed-off-by: Matthew R. Ochs Signed-off

[PATCH v2 12/30] cxlflash: Refine host/device attributes

2015-09-16 Thread Matthew R. Ochs
Implement the following suggestions and add two new attributes to allow for debugging the port LUN table. - use scnprintf() instead of snprintf() - use DEVICE_ATTR_RO and DEVICE_ATTR_RW Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by: Shane Seymour --- drivers

[PATCH v2 11/30] cxlflash: Make functions static

2015-09-16 Thread Matthew R. Ochs
*); struct afu_cmd *cxlflash_cmd_checkout(struct afu *); void cxlflash_cmd_checkin(struct afu_cmd *); void init_pcr(struct cxlflash_cfg *); int init_global(struct cxlflash_cfg *); Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h |5 - drivers/scsi

[PATCH v2 10/30] cxlflash: Correct naming of limbo state and waitq

2015-09-16 Thread Matthew R. Ochs
Limbo is not an accurate representation of this state and is also not consistent with the terminology that other drivers use to represent this concept. Rename the state and and its associated waitq to 'reset'. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by:

[PATCH v2 07/30] cxlflash: Fix context encode mask width

2015-09-16 Thread Matthew R. Ochs
The context encode mask covers more than 32-bits, making it a long integer. This should be noted by appending the ULL width suffix to the mask. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superpipe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v2 08/30] cxlflash: Fix to avoid CXL services during EEH

2015-09-16 Thread Matthew R. Ochs
y to drain ioctls by wrapping the ioctl handler call in a read semaphore and then implementing a small routine that obtains the write semaphore, effectively creating a wait point for all currently executing ioctls. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflas

[PATCH v2 09/30] cxlflash: Fix to stop interrupt processing on remove

2015-09-16 Thread Matthew R. Ochs
removal is imminent. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h | 2 ++ drivers/scsi/cxlflash/main.c | 21 +++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi

[PATCH v2 05/30] cxlflash: Fix data corruption when vLUN used over multiple cards

2015-09-16 Thread Matthew R. Ochs
that card needs to be programmed. The mode word would be setup by the first card, causing the LUN table for the second card to not be programmed. By unconditionally initializing the LUN table (not depending on the mode word), the problem is avoided. Signed-off-by: Matthew R. Ochs Signed-off-by:

[PATCH v2 06/30] cxlflash: Fix to avoid sizeof(bool)

2015-09-16 Thread Matthew R. Ochs
Using sizeof(bool) is considered poor form for various reasons and sparse warns us of that. Correct by changing type from bool to u8. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superpipe.c | 2 +- drivers/scsi/cxlflash/superpipe.h | 2 +- 2 files

[PATCH v2 04/30] cxlflash: Fix potential oops following LUN removal

2015-09-16 Thread Matthew R. Ochs
resolves a potential Oops in the release handler when a dealing with a LUN that has already been removed. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by: Brian King --- drivers/scsi/cxlflash/superpipe.c | 36 1 file changed, 24

[PATCH v2 03/30] cxlflash: Fix read capacity timeout

2015-09-16 Thread Matthew R. Ochs
timeout literal to a more appropriate description. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by: Brian King --- drivers/scsi/cxlflash/superpipe.c | 9 - drivers/scsi/cxlflash/superpipe.h | 2 +- drivers/scsi/cxlflash/vlun.c | 4 ++-- 3 files changed, 7

[PATCH v2 02/30] cxlflash: Replace magic numbers with literals

2015-09-16 Thread Matthew R. Ochs
From: Manoj Kumar Magic numbers are not meaningful and can create confusion. As a remedy, replace them with descriptive literals. Replace 512 with literal MAX_SECTOR_UNIT. Replace 5 with literal CMD_RETRIES. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by: Brian

[PATCH v2 01/30] cxlflash: Fix to avoid invalid port_sel value

2015-09-16 Thread Matthew R. Ochs
of port_sel will be set incorrectly to indicate a single port, though in this case it should have been set to both ports. To fix, use the global mutex to serialize the lookup of the WWID and the subsequent modification of port_sel. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar

[PATCH v2 00/30] cxlflash: Miscellaneous bug fixes and corrections

2015-09-16 Thread Matthew R. Ochs
cxlflash: Fix read capacity timeout Matthew R. Ochs (27): cxlflash: Fix potential oops following LUN removal cxlflash: Fix data corruption when vLUN used over multiple cards cxlflash: Fix to avoid sizeof(bool) cxlflash: Fix context encode mask width cxlflash: Fix to avoid CXL services

Re: [PATCH v2 01/30] cxlflash: Fix to avoid invalid port_sel value

2015-09-16 Thread Matthew R. Ochs
> On Sep 16, 2015, at 2:18 PM, James Bottomley > wrote: > > Could you please add a cover letter (a 0/30) and thread your patches > from that? For large patch series, it really does make following > everything a lot easier for me (and most other people who use a threaded > mail reader). James,

[PATCH v2 30/30] MAINTAINERS: Add cxlflash driver

2015-09-16 Thread Matthew R. Ochs
Add stanza for cxlflash SCSI driver. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 310da42..b0b2c3f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3153,6 +3153,15 @@ F

[PATCH v2 29/30] cxlflash: Fix to avoid state change collision

2015-09-16 Thread Matthew R. Ochs
: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by: Brian King --- drivers/scsi/cxlflash/common.h| 1 + drivers/scsi/cxlflash/main.c | 40 +-- drivers/scsi/cxlflash/superpipe.c | 7 ++- 3 files changed, 41 insertions(+), 7 deletions

[PATCH v2 28/30] cxlflash: Fix to prevent stale AFU RRQ

2015-09-16 Thread Matthew R. Ochs
after each reset. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index a5b45ed..0487fac 100644 --- a/drivers/scsi/cxlflash/main.c +++ b

[PATCH v2 26/30] cxlflash: Fix to prevent EEH recovery failure

2015-09-16 Thread Matthew R. Ochs
ntext mutex is reacquired and the context is made available again. The context can be safely moved to the error state if needed during the unavailable window as no other threads will hold its reference. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superp

[PATCH v2 27/30] cxlflash: Correct spelling, grammar, and alignment mistakes

2015-09-16 Thread Matthew R. Ochs
consistency. Remove extra lines and a few unneeded variables/statements. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h| 2 -- drivers/scsi/cxlflash/main.c | 62 +-- drivers/scsi/cxlflash/sislite.h

[PATCH v2 25/30] cxlflash: Fix MMIO and endianness errors

2015-09-16 Thread Matthew R. Ochs
Sparse uncovered several errors with MMIO operations (accessing directly) and handling endianness. These can cause issues when running in different environments. Introduce __iomem and proper endianness tags/swaps where appropriate to make driver sparse clean. Signed-off-by: Matthew R. Ochs

[PATCH v2 20/30] cxlflash: Correct usage of scsi_host_put()

2015-09-16 Thread Matthew R. Ochs
remove to be the last cleanup action taken and introduce a call to scsi_host_put() in the one initialization error path that does not use remove to cleanup. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH v2 23/30] cxlflash: Remove unnecessary scsi_block_requests

2015-09-16 Thread Matthew R. Ochs
The host reset handler is called with I/O already blocked, thus there is no need to explicitly block and unblock I/O in the handler. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by: Brian King --- drivers/scsi/cxlflash/main.c | 2 -- 1 file changed, 2 deletions

[PATCH v2 22/30] cxlflash: Correct behavior in device reset handler following EEH

2015-09-16 Thread Matthew R. Ochs
the TMF was not sent. To fix, the state is rechecked after coming out of the reset state. When the state is normal, a TMF will be sent out. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by: Brian King --- drivers/scsi/cxlflash/main.c | 5 ++--- 1 file changed, 2

[PATCH v2 19/30] cxlflash: Fix AFU version access/storage and add check

2015-09-16 Thread Matthew R. Ochs
-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h | 2 +- drivers/scsi/cxlflash/main.c| 18 -- drivers/scsi/cxlflash/sislite.h | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/cxlflash/common.h b

[PATCH v2 21/30] cxlflash: Fix to prevent workq from accessing freed memory

2015-09-16 Thread Matthew R. Ochs
there is not a need to process any scheduled work when shutting down. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c

[PATCH v2 24/30] cxlflash: Fix function prolog parameters and return codes

2015-09-16 Thread Matthew R. Ochs
Several function prologs have incorrect parameter names and return code descriptions. This can lead to confusion when reviewing the source and creates inaccurate documentation. To remedy, update the function prologs to properly reflect parameter names and return codes. Signed-off-by: Matthew R

[PATCH v2 18/30] cxlflash: Remove dual port online dependency

2015-09-16 Thread Matthew R. Ochs
R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 23 --- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index 74eb742..e2cc410 100644 --- a/drivers/scsi/cxlflash/main.c +++ b

[PATCH v2 17/30] cxlflash: Fix async interrupt bypass logic

2015-09-16 Thread Matthew R. Ochs
: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index 39ad7a3..74eb742 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash

[PATCH v2 16/30] cxlflash: Fix host link up event handling

2015-09-16 Thread Matthew R. Ochs
-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h | 2 +- drivers/scsi/cxlflash/main.c | 17 + drivers/scsi/cxlflash/main.h | 1 + 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi

[PATCH v2 14/30] cxlflash: Fix to avoid stall while waiting on TMF

2015-09-16 Thread Matthew R. Ochs
such that a bigger hammer reset can occur. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h | 1 + drivers/scsi/cxlflash/main.c | 55 +- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/dr

[PATCH v2 15/30] cxlflash: Fix location of setting resid

2015-09-16 Thread Matthew R. Ochs
The resid is incorrectly set which can lead to unnecessary retry attempts by the stack. This is due to resid _always_ being set using a value returned from the adapter. Instead, the value should only be interpreted and set when in an underrun scenario. Signed-off-by: Matthew R. Ochs Signed-off

[PATCH v2 13/30] cxlflash: Fix to avoid spamming the kernel log

2015-09-16 Thread Matthew R. Ochs
- pr_debug to pr_debug_ratelimited - pr_err to dev_err - pr_debug to dev_dbg Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 105 --- 1 file changed, 58 insertions(+), 47 deletions(-) diff --git a/drivers

[PATCH v2 12/30] cxlflash: Refine host/device attributes

2015-09-16 Thread Matthew R. Ochs
Implement the following suggestions and add two new attributes to allow for debugging the port LUN table. - use scnprintf() instead of snprintf() - use DEVICE_ATTR_RO and DEVICE_ATTR_RW Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by: Shane Seymour --- drivers

[PATCH v2 11/30] cxlflash: Make functions static

2015-09-16 Thread Matthew R. Ochs
*); struct afu_cmd *cxlflash_cmd_checkout(struct afu *); void cxlflash_cmd_checkin(struct afu_cmd *); void init_pcr(struct cxlflash_cfg *); int init_global(struct cxlflash_cfg *); Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h |5 - drivers/scsi

[PATCH v2 10/30] cxlflash: Correct naming of limbo state and waitq

2015-09-16 Thread Matthew R. Ochs
Limbo is not an accurate representation of this state and is also not consistent with the terminology that other drivers use to represent this concept. Rename the state and and its associated waitq to 'reset'. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by:

[PATCH v2 09/30] cxlflash: Fix to stop interrupt processing on remove

2015-09-16 Thread Matthew R. Ochs
removal is imminent. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h | 2 ++ drivers/scsi/cxlflash/main.c | 21 +++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi

[PATCH v2 03/30] cxlflash: Fix read capacity timeout

2015-09-16 Thread Matthew R. Ochs
timeout literal to a more appropriate description. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by: Brian King --- drivers/scsi/cxlflash/superpipe.c | 9 - drivers/scsi/cxlflash/superpipe.h | 2 +- drivers/scsi/cxlflash/vlun.c | 4 ++-- 3 files changed, 7

[PATCH v2 04/30] cxlflash: Fix potential oops following LUN removal

2015-09-16 Thread Matthew R. Ochs
resolves a potential Oops in the release handler when a dealing with a LUN that has already been removed. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by: Brian King --- drivers/scsi/cxlflash/superpipe.c | 36 1 file changed, 24

[PATCH v2 01/30] cxlflash: Fix to avoid invalid port_sel value

2015-09-16 Thread Matthew R. Ochs
of port_sel will be set incorrectly to indicate a single port, though in this case it should have been set to both ports. To fix, use the global mutex to serialize the lookup of the WWID and the subsequent modification of port_sel. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar

[PATCH v2 05/30] cxlflash: Fix data corruption when vLUN used over multiple cards

2015-09-16 Thread Matthew R. Ochs
that card needs to be programmed. The mode word would be setup by the first card, causing the LUN table for the second card to not be programmed. By unconditionally initializing the LUN table (not depending on the mode word), the problem is avoided. Signed-off-by: Matthew R. Ochs Signed-off-by:

[PATCH v2 07/30] cxlflash: Fix context encode mask width

2015-09-16 Thread Matthew R. Ochs
The context encode mask covers more than 32-bits, making it a long integer. This should be noted by appending the ULL width suffix to the mask. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superpipe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v2 08/30] cxlflash: Fix to avoid CXL services during EEH

2015-09-16 Thread Matthew R. Ochs
y to drain ioctls by wrapping the ioctl handler call in a read semaphore and then implementing a small routine that obtains the write semaphore, effectively creating a wait point for all currently executing ioctls. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflas

[PATCH v2 06/30] cxlflash: Fix to avoid sizeof(bool)

2015-09-16 Thread Matthew R. Ochs
Using sizeof(bool) is considered poor form for various reasons and sparse warns us of that. Correct by changing type from bool to u8. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superpipe.c | 2 +- drivers/scsi/cxlflash/superpipe.h | 2 +- 2 files

[PATCH v2 02/30] cxlflash: Replace magic numbers with literals

2015-09-16 Thread Matthew R. Ochs
From: Manoj Kumar Magic numbers are not meaningful and can create confusion. As a remedy, replace them with descriptive literals. Replace 512 with literal MAX_SECTOR_UNIT. Replace 5 with literal CMD_RETRIES. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Suggested-by: Brian

[PATCH v2 00/30] cxlflash: Miscellaneous bug fixes and corrections

2015-09-16 Thread Matthew R. Ochs
cxlflash: Fix read capacity timeout Matthew R. Ochs (27): cxlflash: Fix potential oops following LUN removal cxlflash: Fix data corruption when vLUN used over multiple cards cxlflash: Fix to avoid sizeof(bool) cxlflash: Fix context encode mask width cxlflash: Fix to avoid CXL services

Re: [PATCH 00/29] cxlflash: Miscellaneous bug fixes and corrections

2015-09-15 Thread Matthew R. Ochs
> On Sep 15, 2015, at 9:50 PM, Ian Munsie wrote: > > Hi Matt & Manoj, > > Can you also add linuxppc-...@lists.ozlabs.org to the Cc list for > version 2? Will do. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More

Re: [PATCH 00/29] cxlflash: Miscellaneous bug fixes and corrections

2015-09-14 Thread Matthew R. Ochs
> On Sep 13, 2015, at 8:12 PM, Ian Munsie wrote: > > Hi Matt & Manoj, > > Just a general comment about this series - I'd like to see more detailed > commit messages for almost all these patches. Of course James is the > scsi maintainer and it's up to him whether to take these as is or not, > but

[PATCH 29/29] MAINTAINERS: Add cxlflash driver

2015-09-11 Thread Matthew R. Ochs
Add stanza for cxlflash SCSI driver. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 67a4443..49084ad 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3153,6 +3153,15 @@ F

[PATCH 28/29] cxlflash: Clear AFU RRQ following reset

2015-09-11 Thread Matthew R. Ochs
The AFU RRQ in host memory needs to be cleared after each reset to avoid stale entries from being processed by the AFU. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/cxlflash

[PATCH 22/29] cxlflash: Recheck state after adapter reset

2015-09-11 Thread Matthew R. Ochs
Add a state recheck in the device reset handler such that a TMF will still be send out after an adapter reset. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi

[PATCH 24/29] cxlflash: Update function prologs

2015-09-11 Thread Matthew R. Ochs
Update the function prologs to properly reflect parameter names and return codes. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 68 1 file changed, 25 insertions(+), 43 deletions(-) diff --git a

[PATCH 20/29] cxlflash: Correct usage of scsi_host_put()

2015-09-11 Thread Matthew R. Ochs
. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index fc77cd4..1856a73 100644 --- a/drivers/scsi/cxlflash/main.c +++ b

[PATCH 19/29] cxlflash: Properly obtain AFU version and check it

2015-09-11 Thread Matthew R. Ochs
rface. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h | 2 +- drivers/scsi/cxlflash/main.c| 18 -- drivers/scsi/cxlflash/sislite.h | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/cxlflash/commo

[PATCH 23/29] cxlflash: Remove unnecessary scsi_block_requests

2015-09-11 Thread Matthew R. Ochs
The host reset handler is called with I/O already blocked, thus there is no need to explicitly block and unblock I/O in the handler. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/scsi

[PATCH 27/29] cxlflash: Spelling, grammar, and alignment changes

2015-09-11 Thread Matthew R. Ochs
Fix spelling and grammar issues. Update some comments for clarity and consistency. Remove extra lines and a few unneeded variables/statements. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h| 2 -- drivers/scsi/cxlflash/main.c | 62

[PATCH 25/29] cxlflash: Fix MMIO and endianness errors

2015-09-11 Thread Matthew R. Ochs
Introduce __iomem and proper endianness tags/swaps where appropriate to make driver sparse clean. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h| 10 +- drivers/scsi/cxlflash/main.c | 25 + drivers/scsi

[PATCH 26/29] cxlflash: Drop context mutex while processing sense

2015-09-11 Thread Matthew R. Ochs
context is made available again. The context can be safely moved to the error state if needed during the unavailable window as no other threads will hold its reference. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superpipe.c | 9 + 1 file changed

[PATCH 21/29] cxlflash: Move workq termination earlier on remove

2015-09-11 Thread Matthew R. Ochs
The workq should be terminated prior to freeing memory. Move the termination call earlier in remove and use cancel_work_sync() instead of flush_work(). Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 18/29] cxlflash: Remove dual port online dependency

2015-09-11 Thread Matthew R. Ochs
At present, both ports must be online for the device to configure properly. Remove this dependency and the unnecessary internal LUN override logic as well. Additionally, change the return code variable to match that used throughout the driver. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj

[PATCH 16/29] cxlflash: Rescan host following link up event

2015-09-11 Thread Matthew R. Ochs
The host should be rescanned after a link up event. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h | 2 +- drivers/scsi/cxlflash/main.c | 17 + drivers/scsi/cxlflash/main.h | 1 + 3 files changed, 15 insertions(+), 5

[PATCH 17/29] cxlflash: Bypass async interrupt bits that are off

2015-09-11 Thread Matthew R. Ochs
: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index 39ad7a3..74eb742 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash

[PATCH 15/29] cxlflash: Only set resid when needed

2015-09-11 Thread Matthew R. Ochs
The resid should only be set in an underrun scenario. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash

[PATCH 13/29] cxlflash: Refine print statements

2015-09-11 Thread Matthew R. Ochs
Various print changes: pr_* to dev_*, *_dbg to *_devel, and *_dbg to *_dbg_ratelimited. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 105 --- 1 file changed, 58 insertions(+), 47 deletions(-) diff --git

[PATCH 14/29] cxlflash: Protect TMF waitq with spinlock

2015-09-11 Thread Matthew R. Ochs
Use a spinlock to protect the TMF waitq instead of borrowing the internal waitq lock. Also introduce a timeout for when the TMF fails to complete so the appropriate status can be sent back to the stack. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash

[PATCH 12/29] cxlflash: Refine host/device attributes

2015-09-11 Thread Matthew R. Ochs
Implement the following suggestions by Shane Seymour and add two new attributes to allow for debugging the port LUN table. - use scnprintf() instead of snprintf() - use DEVICE_ATTR_RO and DEVICE_ATTR_RW Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash

[PATCH 00/29] cxlflash: Miscellaneous bug fixes and corrections

2015-09-11 Thread Matthew R. Ochs
find_and_create_lun() cxlflash: Add a literal for units of max_sector cxlflash: Increase timeout value for read capacity to 30 seconds Matthew R. Ochs (26): cxlflash: Obtain additional sdev reference cxlflash: Always attempt LUN table initialization cxlflash: Change rht_needs_ws from bool to u8

[PATCH 10/29] cxlflash: Rename limbo to reset

2015-09-11 Thread Matthew R. Ochs
Rename the state and waitq. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h| 4 ++-- drivers/scsi/cxlflash/main.c | 26 +- drivers/scsi/cxlflash/superpipe.c | 14 +++--- 3 files changed, 22 insertions

[PATCH 11/29] cxlflash: Make functions static

2015-09-11 Thread Matthew R. Ochs
init_pcr(struct cxlflash_cfg *); int init_global(struct cxlflash_cfg *); Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h |5 - drivers/scsi/cxlflash/main.c | 1018 2 files changed, 509 insertions

[PATCH 09/29] cxlflash: Check for removal when processing interrupt

2015-09-11 Thread Matthew R. Ochs
To avoid processing an interrupt while memory may be yanked, check for while in the interrupt handler. Bail when removal is imminent. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h | 2 ++ drivers/scsi/cxlflash/main.c | 21

[PATCH 08/29] cxlflash: Add ioctl drain

2015-09-11 Thread Matthew R. Ochs
Create the ability to drain ioctls by wrapping the ioctl handler call in a read semaphore and then implementing a small routine that obtains the write semaphore, effectively creating a wait point for all currently executing ioctls. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar

[PATCH 04/29] cxlflash: Obtain additional sdev reference

2015-09-11 Thread Matthew R. Ochs
resovles a potential Oops in the release handler when a dealing with a LUN that has already been removed. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superpipe.c | 36 1 file changed, 24 insertions(+), 12 deletions

[PATCH 01/29] cxlflash: Move global.mutex to caller of find_and_create_lun()

2015-09-11 Thread Matthew R. Ochs
From: Manoj Kumar Since the retrieved LUN is modified in the caller, hold the mutex across modifications as well. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/lunmgt.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a

[PATCH 07/29] cxlflash: Add ULL specifier to context encode mask

2015-09-11 Thread Matthew R. Ochs
The context encode mask covers more than 32-bits, making it a long integer. This should be noted by appending a specifier, 'ULL' in this case. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superpipe.h | 2 +- 1 file changed, 1 insertion(+),

[PATCH 06/29] cxlflash: Change rht_needs_ws from bool to u8

2015-09-11 Thread Matthew R. Ochs
Fix sparse sizeof(bool) warning by changing type from bool to u8. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superpipe.c | 2 +- drivers/scsi/cxlflash/superpipe.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi

[PATCH 05/29] cxlflash: Always attempt LUN table initialization

2015-09-11 Thread Matthew R. Ochs
ugh a second (or greater) adapter is configured correctly by programming the adapter's LUN table. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/vlun.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/scs

[PATCH 02/29] cxlflash: Add a literal for units of max_sector

2015-09-11 Thread Matthew R. Ochs
From: Manoj Kumar Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superpipe.c | 3 ++- drivers/scsi/cxlflash/superpipe.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/cxlflash/superpipe.c b/drivers/scsi/cxlflash

[PATCH 03/29] cxlflash: Increase timeout value for read capacity to 30 seconds

2015-09-11 Thread Matthew R. Ochs
From: Manoj Kumar Make literals for number of retries as well. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superpipe.c | 8 drivers/scsi/cxlflash/superpipe.h | 3 ++- drivers/scsi/cxlflash/vlun.c | 5 +++-- 3 files changed, 9

Re: [PATCH v6 2/3] cxlflash: Superpipe support

2015-09-08 Thread Matthew R. Ochs
ssues can get addressed in a follow on patch. > > Reviewed-by: Brian King > > On 08/13/2015 09:47 PM, Matthew R. Ochs wrote: >> +/** >> + * cxlflash_term_global_luns() - frees resources associated with global LUN >> list >> + */ >> +void cxlflash_

[PATCH] cxlflash: Remove unused variable from queuecommand

2015-08-26 Thread Matthew R. Ochs
Flash Error Recovery and Superpipe" series. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reported-by: kbuild test robot --- drivers/scsi/cxlflash/main.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlfl

Re: [patch] cxlflash: shift wrapping bug in afu_link_reset()

2015-08-18 Thread Matthew R. Ochs
; port); > + port_sel |= (1ULL << port); > writeq_be(port_sel, &afu->afu_map->global.regs.afu_port_sel); > cxlflash_afu_sync(afu, 0, 0, AFU_GSYNC); > Acked-by: Matthew R. Ochs -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v6 1/3] cxlflash: Base error recovery support

2015-08-17 Thread Matthew R. Ochs
Hi Brian, Thanks for reviewing. All good suggestions that I am fine with implementing. As these are fairly minor, would you be okay with these being made in a separate ‘fix' patch series? -matt > On Aug 17, 2015, at 9:38 AM, Brian King wrote: > > On 08/13/2015 09:47 PM, M

Re: [patch] cxlflash: off by one bug in cxlflash_show_port_status()

2015-08-15 Thread Matthew R. Ochs
> On Aug 14, 2015, at 3:35 PM, Dan Carpenter wrote: > > The > should be >= or we read one element past the end of the array. Dan - Good catch! Acked-by: Matthew R. Ochs > > Fixes: c21e0bbfc485 ('cxlflash: Base support for IBM CXL Flash Adapter') > Signed

[PATCH v6 2/3] cxlflash: Superpipe support

2015-08-13 Thread Matthew R. Ochs
Add superpipe supporting infrastructure to device driver for the IBM CXL Flash adapter. This patch allows userspace applications to take advantage of the accelerated I/O features that this adapter provides and bypass the traditional filesystem stack. Signed-off-by: Matthew R. Ochs Signed-off-by

[PATCH v6 3/3] cxlflash: Virtual LUN support

2015-08-13 Thread Matthew R. Ochs
: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Michael Neuling Reviewed-by: Wen Xiong --- Documentation/powerpc/cxlflash.txt | 63 +- drivers/scsi/cxlflash/Makefile |2 +- drivers/scsi/cxlflash/common.h |4 + drivers/scsi/cxlflash/lunmgt.c |3 + drivers

[PATCH v6 1/3] cxlflash: Base error recovery support

2015-08-13 Thread Matthew R. Ochs
state, normal operations are no longer allowed. Only specially designated operations related to graceful cleanup are permitted. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Daniel Axtens Reviewed-by: Michael Neuling Reviewed-by: Wen Xiong --- drivers/scsi/cxlflash

[PATCH v6 0/3] CXL Flash Error Recovery and Superpipe

2015-08-13 Thread Matthew R. Ochs
si_execute() to issue SCSI commands - Use existing SCSI defines - Sleep instead of busy-wait - Remove duplicate parenths - Refine patch staging Matthew R. Ochs (3): cxlflash: Base error recovery support cxlflash: Superpipe support cxlflash: Virtual LUN support Documentation/ioctl/ioctl-number.

[PATCH v5 2/3] cxlflash: Superpipe support

2015-08-12 Thread Matthew R. Ochs
Add superpipe supporting infrastructure to device driver for the IBM CXL Flash adapter. This patch allows userspace applications to take advantage of the accelerated I/O features that this adapter provides and bypass the traditional filesystem stack. Signed-off-by: Matthew R. Ochs Signed-off-by

<    1   2   3   4   5   >