Re: [PATCH 3/3] cxlflash: drop unlikely before IS_ERR_OR_NULL

2015-10-01 Thread Matthew R. Ochs
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 v4 12/32] cxlflash: Fix to avoid spamming the kernel log

2015-09-29 Thread Matthew R. Ochs
> On Sep 29, 2015, at 12:05 AM, Andrew Donnellan > wrote: > On 26/09/15 09:15, Matthew R. Ochs wrote: >> During run-time the driver can be very chatty and spam the system >> kernel log. Various print statements can be limited and/or moved >> to development-only m

Re: [PATCH v4 29/32] cxlflash: Fix to double the delay each time

2015-09-29 Thread Matthew R. Ochs
> On Sep 28, 2015, at 8:40 PM, Daniel Axtens wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > "Matthew R. Ochs" writes: > >> From: Manoj Kumar >> >> The operator used to double the delay is incorrect and >> does not re

Re: [PATCH v4 23/32] cxlflash: Fix function prolog parameters and return codes

2015-09-29 Thread Matthew R. Ochs
> On Sep 28, 2015, at 11:36 PM, Andrew Donnellan > wrote: > On 26/09/15 09:18, Matthew R. Ochs wrote: >> >> */ >> static int send_tmf(struct afu *afu, struct scsi_cmnd *scp, u64 tmfcmd) >> { >> @@ -491,9 +490,7 @@ static const char *cxlflash

Re: [PATCH v4 27/32] cxlflash: Fix to prevent stale AFU RRQ

2015-09-29 Thread Matthew R. Ochs
> On Sep 28, 2015, at 8:36 PM, Daniel Axtens wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > "Matthew R. Ochs" writes: > >> Following an adapter reset, the AFU RRQ that resides in host memory >> holds stale data. This can lead to a c

Re: [PATCH v4 25/32] cxlflash: Fix to prevent EEH recovery failure

2015-09-29 Thread Matthew R. Ochs
> On Sep 28, 2015, at 8:25 PM, Daniel Axtens wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > "Matthew R. Ochs" writes: > > >> The process_sense() routine can perform a read capacity which >> can take some time to complete.

Re: [PATCH v4 32/32] cxlflash: Fix to avoid potential deadlock on EEH

2015-09-29 Thread Matthew R. Ochs
> On Sep 28, 2015, at 6:41 PM, Brian King wrote: > On 09/25/2015 06:19 PM, Matthew R. Ochs wrote: >> static int write_same16(struct scsi_device *sdev, >> @@ -433,9 +451,20 @@ static int write_same16(struct scsi_device *sdev, >> put_unaligned_be32(ws_limit

Re: [PATCH v4 17/32] cxlflash: Remove dual port online dependency

2015-09-29 Thread Matthew R. Ochs
> On Sep 28, 2015, at 6:37 PM, Daniel Axtens wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > Hi, > >> static int afu_set_wwpn(struct afu *afu, int port, u64 *fc_regs, u64 wwpn) >> { >> -int ret = 0; >> +int rc = 0; > I realise it's nice to have things consistent, but ma

Re: [PATCH v4 08/32] cxlflash: Fix to avoid CXL services during EEH

2015-09-29 Thread Matthew R. Ochs
> On Sep 28, 2015, at 6:05 PM, Daniel Axtens wrote: > > You have two versions of check_state() below, which is a bit > confusing. It looks like you've moved the function and also added the > up/down of the read semaphore. I assume that's all that changed? Correct. It was originally moved to mee

[PATCH v4 32/32] cxlflash: Fix to avoid potential deadlock on EEH

2015-09-25 Thread Matthew R. Ochs
eported-by: Brian King Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/superpipe.c | 30 +- drivers/scsi/cxlflash/superpipe.h | 2 ++ drivers/scsi/cxlflash/vlun.c | 29 + 3 files changed, 60

[PATCH v4 31/32] cxlflash: Correct trace string

2015-09-25 Thread Matthew R. Ochs
The trace following the failure of alloc_mem() incorrectly identifies which function failed. This can lead to misdiagnosing a failure. Fix the string to correctly indicate that alloc_mem() failed. Reported-by: Brian King Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by

[PATCH v4 23/32] cxlflash: Fix function prolog parameters and return codes

2015-09-25 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 v4 29/32] cxlflash: Fix to double the delay each time

2015-09-25 Thread Matthew R. Ochs
From: Manoj Kumar The operator used to double the delay is incorrect and does not result in delay doubling. To fix, use a left shift instead of the XOR operator. Reported-by: Tomas Henzl Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King --- drivers/scsi

[PATCH v4 30/32] cxlflash: Fix to avoid corrupting adapter fops

2015-09-25 Thread Matthew R. Ochs
tthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h| 3 +-- drivers/scsi/cxlflash/main.c | 1 + drivers/scsi/cxlflash/superpipe.c | 11 +-- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/cxlflash/common.h b/drivers

[PATCH v4 28/32] MAINTAINERS: Add cxlflash driver

2015-09-25 Thread Matthew R. Ochs
Add stanza for cxlflash SCSI driver. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King Reviewed-by: Andrew Donnellan --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 274f854..f2f3046 100644 --- a

[PATCH v4 27/32] cxlflash: Fix to prevent stale AFU RRQ

2015-09-25 Thread Matthew R. Ochs
after each reset. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King --- 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 24aedfb..ab11ee6 100644 --- a/drivers

[PATCH v4 25/32] cxlflash: Fix to prevent EEH recovery failure

2015-09-25 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 Reviewed-by: Brian King --- dr

[PATCH v4 26/32] cxlflash: Correct spelling, grammar, and alignment mistakes

2015-09-25 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/common.h| 2 -- drivers/scsi/cxlflash/main.c | 62 +-- drivers/scsi

[PATCH v4 24/32] cxlflash: Fix MMIO and endianness errors

2015-09-25 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 v4 22/32] cxlflash: Remove unnecessary scsi_block_requests

2015-09-25 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/main.c | 2 -- 1 file changed, 2 deletions

[PATCH v4 21/32] cxlflash: Correct behavior in device reset handler following EEH

2015-09-25 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/main.c | 5 ++--- 1 file changed, 2

[PATCH v4 20/32] cxlflash: Fix to prevent workq from accessing freed memory

2015-09-25 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers

[PATCH v4 17/32] cxlflash: Remove dual port online dependency

2015-09-25 Thread Matthew R. Ochs
R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King --- 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 ed9fd8c..d45388f 100644 --- a/drivers

[PATCH v4 15/32] cxlflash: Fix host link up event handling

2015-09-25 Thread Matthew R. Ochs
-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King Conflicts: drivers/scsi/cxlflash/common.h --- drivers/scsi/cxlflash/common.h | 1 + drivers/scsi/cxlflash/main.c | 17 + drivers/scsi/cxlflash/main.h | 1 + 3 files changed, 15 insertions

[PATCH v4 18/32] cxlflash: Fix AFU version access/storage and add check

2015-09-25 Thread Matthew R. Ochs
-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King --- 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

[PATCH v4 19/32] cxlflash: Correct usage of scsi_host_put()

2015-09-25 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/main.c | 3 ++- 1 file changed

[PATCH v4 13/32] cxlflash: Fix to avoid stall while waiting on TMF

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

[PATCH v4 12/32] cxlflash: Fix to avoid spamming the kernel log

2015-09-25 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 Reviewed-by: Brian King Conflicts: drivers/scsi/cxlflash/main.c --- drivers/scsi/cxlflash/main.c | 109

[PATCH v4 16/32] cxlflash: Fix async interrupt bypass logic

2015-09-25 Thread Matthew R. Ochs
: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King --- 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 98fdac1..ed9fd8c 100644 --- a/drivers/scsi/cxlflash/main.c +++ b

[PATCH v4 14/32] cxlflash: Fix location of setting resid

2015-09-25 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 v4 11/32] cxlflash: Refine host/device attributes

2015-09-25 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 Suggested-by: Shane Seymour Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by

[PATCH v4 08/32] cxlflash: Fix to avoid CXL services during EEH

2015-09-25 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 v4 10/32] cxlflash: Make functions static

2015-09-25 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash

[PATCH v4 04/32] cxlflash: Fix potential oops following LUN removal

2015-09-25 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/superpipe.c | 35 +++ 1 file changed, 23

[PATCH v4 09/32] cxlflash: Correct naming of limbo state and waitq

2015-09-25 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 Reviewed-by:

[PATCH v4 06/32] cxlflash: Fix to avoid sizeof(bool)

2015-09-25 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/superpipe.c | 2 +- drivers/scsi/cxlflash

[PATCH v4 07/32] cxlflash: Fix context encode mask width

2015-09-25 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/superpipe.h | 2 +- 1 file changed, 1

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

2015-09-25 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 v4 03/32] cxlflash: Fix read capacity timeout

2015-09-25 Thread Matthew R. Ochs
timeout literal to a more appropriate description. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-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 v4 02/32] cxlflash: Replace magic numbers with literals

2015-09-25 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 Reviewed-by: Brian King

[PATCH v4 01/32] cxlflash: Fix to avoid invalid port_sel value

2015-09-25 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 v4 00/32] cxlflash: Miscellaneous bug fixes and corrections

2015-09-25 Thread Matthew R. Ochs
rporate comments from Ian Munsie - Rework commit messages to be more descriptive - Add state change serialization patch Manoj Kumar (4): cxlflash: Fix to avoid invalid port_sel value cxlflash: Replace magic numbers with literals cxlflash: Fix read capacity timeout cxlflash: Fix to double the

Re: [PATCH v3 31/32] cxlflash: Fix to avoid corrupting adapter fops

2015-09-25 Thread Matthew R. Ochs
> On Sep 25, 2015, at 4:23 PM, Brian King wrote: > On 09/24/2015 02:44 PM, Matthew R. Ochs wrote: >> @@ -1293,8 +1291,8 @@ static int cxlflash_disk_attach(struct scsi_device >> *sdev, >> >> int fd = -1; >> >> -/* On first attach s

Re: [PATCH v3 28/32] cxlflash: Fix to avoid state change collision

2015-09-25 Thread Matthew R. Ochs
> On Sep 25, 2015, at 4:10 PM, Brian King wrote: > On 09/24/2015 02:42 PM, Matthew R. Ochs wrote: >> diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c >> index ab11ee6..325ba31 100644 >> --- a/drivers/scsi/cxlflash/main.c >> +++ b/drivers/scs

Re: [PATCH v3 08/32] cxlflash: Fix to avoid CXL services during EEH

2015-09-25 Thread Matthew R. Ochs
> On Sep 24, 2015, at 8:23 PM, Brian King wrote: > On 09/24/2015 02:38 PM, Matthew R. Ochs wrote: >> diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c >> index 3e3ccf1..6e85c77 100644 >> --- a/drivers/scsi/cxlflash/main.c >> +++ b/drivers/scsi/

Re: [PATCH v3 11/32] cxlflash: Refine host/device attributes

2015-09-24 Thread Matthew R. Ochs
Somehow the Suggested-by tag was dropped from this one. Adding it back. -matt > On Sep 24, 2015, at 2:39 PM, Matthew R. Ochs > wrote: > > Implement the following suggestions and add two new attributes > to allow for debugging the port LUN table. > > - use scnprintf(

[PATCH v3 29/32] MAINTAINERS: Add cxlflash driver

2015-09-24 Thread Matthew R. Ochs
Add stanza for cxlflash SCSI driver. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 274f854..f2f3046 100644 --- a/MAINTAINERS +++ b/MAINTAINERS

[PATCH v3 31/32] cxlflash: Fix to avoid corrupting adapter fops

2015-09-24 Thread Matthew R. Ochs
ff-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/common.h| 2 -- drivers/scsi/cxlflash/superpipe.c | 6 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi/cxlflash/common.h index 89c82d2..5efad98 100644

[PATCH v3 32/32] cxlflash: Correct trace string

2015-09-24 Thread Matthew R. Ochs
The trace following the failure of alloc_mem() incorrectly identifies which function failed. This can lead to misdiagnosing a failure. Fix the string to correctly indicate that alloc_mem() failed. Reported-by: Brian King Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar

[PATCH v3 30/32] cxlflash: Fix to double the delay each time

2015-09-24 Thread Matthew R. Ochs
From: Manoj Kumar The operator used to double the delay is incorrect and does not result in delay doubling. To fix, use a left shift instead of the XOR operator. Reported-by: Tomas Henzl Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar --- drivers/scsi/cxlflash/main.c | 2 +- 1

[PATCH v3 27/32] cxlflash: Fix to prevent stale AFU RRQ

2015-09-24 Thread Matthew R. Ochs
after each reset. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King --- 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 24aedfb..ab11ee6 100644 --- a/drivers

[PATCH v3 28/32] cxlflash: Fix to avoid state change collision

2015-09-24 Thread Matthew R. Ochs
: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Conflicts: drivers/scsi/cxlflash/main.c --- drivers/scsi/cxlflash/common.h| 1 + drivers/scsi/cxlflash/main.c | 48 ++- drivers/scsi/cxlflash/superpipe.c | 7 +- 3 files changed, 44 insertions

[PATCH v3 26/32] cxlflash: Correct spelling, grammar, and alignment mistakes

2015-09-24 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/common.h| 2 -- drivers/scsi/cxlflash/main.c | 62 +-- drivers/scsi

[PATCH v3 18/32] cxlflash: Fix AFU version access/storage and add check

2015-09-24 Thread Matthew R. Ochs
-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King --- 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

[PATCH v3 20/32] cxlflash: Fix to prevent workq from accessing freed memory

2015-09-24 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 v3 21/32] cxlflash: Correct behavior in device reset handler following EEH

2015-09-24 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/main.c | 5 ++--- 1 file changed, 2

[PATCH v3 24/32] cxlflash: Fix MMIO and endianness errors

2015-09-24 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 v3 19/32] cxlflash: Correct usage of scsi_host_put()

2015-09-24 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 v3 25/32] cxlflash: Fix to prevent EEH recovery failure

2015-09-24 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 Reviewed-by: Brian King --- dr

[PATCH v3 23/32] cxlflash: Fix function prolog parameters and return codes

2015-09-24 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 v3 22/32] cxlflash: Remove unnecessary scsi_block_requests

2015-09-24 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/main.c | 2 -- 1 file changed, 2 deletions

[PATCH v3 09/32] cxlflash: Correct naming of limbo state and waitq

2015-09-24 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 Reviewed-by:

[PATCH v3 04/32] cxlflash: Fix potential oops following LUN removal

2015-09-24 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 --- drivers/scsi/cxlflash/superpipe.c | 35 +++ 1 file changed, 23 insertions(+), 12 deletions

[PATCH v3 03/32] cxlflash: Fix read capacity timeout

2015-09-24 Thread Matthew R. Ochs
timeout literal to a more appropriate description. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-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 v3 12/32] cxlflash: Fix to avoid spamming the kernel log

2015-09-24 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 Reviewed-by: Brian King Conflicts: drivers/scsi/cxlflash/main.c --- drivers/scsi/cxlflash/main.c | 109

[PATCH v3 13/32] cxlflash: Fix to avoid stall while waiting on TMF

2015-09-24 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 v3 15/32] cxlflash: Fix host link up event handling

2015-09-24 Thread Matthew R. Ochs
-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King Conflicts: drivers/scsi/cxlflash/common.h --- drivers/scsi/cxlflash/common.h | 1 + drivers/scsi/cxlflash/main.c | 17 + drivers/scsi/cxlflash/main.h | 1 + 3 files changed, 15 insertions

[PATCH v3 16/32] cxlflash: Fix async interrupt bypass logic

2015-09-24 Thread Matthew R. Ochs
: Matthew R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King --- 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 98fdac1..ed9fd8c 100644 --- a/drivers/scsi/cxlflash/main.c +++ b

[PATCH v3 10/32] cxlflash: Make functions static

2015-09-24 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash

[PATCH v3 06/32] cxlflash: Fix to avoid sizeof(bool)

2015-09-24 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/superpipe.c | 2 +- drivers/scsi/cxlflash

[PATCH v3 17/32] cxlflash: Remove dual port online dependency

2015-09-24 Thread Matthew R. Ochs
R. Ochs Signed-off-by: Manoj N. Kumar Reviewed-by: Brian King --- 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 ed9fd8c..d45388f 100644 --- a/drivers

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

2015-09-24 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 v3 14/32] cxlflash: Fix location of setting resid

2015-09-24 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 v3 07/32] cxlflash: Fix context encode mask width

2015-09-24 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 Reviewed-by: Brian King --- drivers/scsi/cxlflash/superpipe.h | 2 +- 1 file changed, 1

[PATCH v3 02/32] cxlflash: Replace magic numbers with literals

2015-09-24 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 Reviewed-by: Brian King

[PATCH v3 11/32] cxlflash: Refine host/device attributes

2015-09-24 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 --- drivers/scsi/cxlflash/main.c | 180

[PATCH v3 08/32] cxlflash: Fix to avoid CXL services during EEH

2015-09-24 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 v3 01/32] cxlflash: Fix to avoid invalid port_sel value

2015-09-24 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 v3 00/32] cxlflash: Miscellaneous bug fixes and corrections

2015-09-24 Thread Matthew R. Ochs
comments from Ian Munsie - Rework commit messages to be more descriptive - Add state change serialization patch Manoj Kumar (4): cxlflash: Fix to avoid invalid port_sel value cxlflash: Replace magic numbers with literals cxlflash: Fix read capacity timeout cxlflash: Fix to double the delay eac

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

2015-09-22 Thread Matthew R. Ochs
> On Sep 22, 2015, at 3:53 PM, Brian King wrote: > On 09/16/2015 04:30 PM, Matthew R. Ochs wrote: >> Currently, scsi_host_put() is being called prematurely in the >> remove path and is missing entirely in an error cleanup path. >> The former can lead to memory be

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

2015-09-22 Thread Matthew R. Ochs
> On Sep 21, 2015, at 5:02 PM, Brian King wrote: > On 09/16/2015 04:30 PM, Matthew R. Ochs wrote: >> 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. Additi

Re: [patch] cxlflash: a couple off by one bugs

2015-09-22 Thread Matthew R. Ochs
> On Sep 22, 2015, at 7:32 AM, Dan Carpenter wrote: > > The "> MAX_CONTEXT" should be ">= MAX_CONTEXT". Otherwise we go one > step beyond the end of the cfg->ctx_tbl[] array. Acked-by: Matthew R. Ochs > > Signed-off-by: Dan Carpenter > >

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

2015-09-21 Thread Matthew R. Ochs
> On Sep 21, 2015, at 1:24 PM, Brian King wrote: > On 09/16/2015 04:30 PM, Matthew R. Ochs wrote: >> Borrowing the TMF waitq's spinlock causes a stall condition when >> waiting for the TMF to complete. To remedy, introduce our own spin >> lock to serialize TMF

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

2015-09-21 Thread Matthew R. Ochs
> On Sep 21, 2015, at 7:44 AM, Tomas Henzl wrote: > On 16.9.2015 23:32, Matthew R. Ochs wrote: >> The adapter state machine is susceptible to missing and/or >> corrupting state updates at runtime. This can lead to a variety >> of unintended issues and is due to the

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

2015-09-21 Thread Matthew R. Ochs
> On Sep 21, 2015, at 7:25 AM, Tomas Henzl wrote: > On 16.9.2015 23:31, Matthew R. Ochs wrote: >> The workq can process work in parallel with a remove event, leading >> to a condition where the workq handler can access freed memory. >> >> To remedy, the workq

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

2015-09-21 Thread Matthew R. Ochs
> On Sep 21, 2015, at 7:18 AM, Tomas Henzl wrote: > On 16.9.2015 23:28, Matthew R. Ochs wrote: >> >> + >> +write_rrin: >> +nretry = 0; >> +writeq_be(rrin, &afu->host_map->ioarrin); >> +do { >> +rrin = readq_be

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

2015-09-21 Thread Matthew R. Ochs
> On Sep 21, 2015, at 7:11 AM, Tomas Henzl wrote: > On 16.9.2015 23:27, Matthew R. Ochs wrote: >> When a LUN is removed, the sdev that is associated with the LUN >> remains intact until its reference count drops to 0. In order >> to prevent an sdev from being removed

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

2015-09-21 Thread Matthew R. Ochs
> On Sep 21, 2015, at 6:36 AM, Tomas Henzl wrote: > On 16.9.2015 23:26, Matthew R. Ochs wrote: >> From: Manoj Kumar >> >> The timeout value for read capacity is too small. Certain devices >> may take longer to respond and thus the command may prematurely >&g

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

2015-09-21 Thread Matthew R. Ochs
> On Sep 21, 2015, at 6:33 AM, Tomas Henzl wrote: > On 19.9.2015 01:26, Matthew R. Ochs wrote: >>> On Sep 18, 2015, at 6:59 AM, Tomas Henzl wrote: >>> On 17.9.2015 19:16, Matthew R. Ochs wrote: >>>>> On Sep 17, 2015, at 7:38 AM, Tomas Henzl wrote: >

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

2015-09-18 Thread Matthew R. Ochs
> On Sep 18, 2015, at 4:34 PM, Brian King wrote: > On 09/16/2015 04:29 PM, Matthew R. Ochs wrote: >> >> +ssize_t bytes = 0; >> +__be64 __iomem *fc_port; >> + >> +if (port >= NUM_FC_PORTS) >> +return 0; >> + >

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

2015-09-18 Thread Matthew R. Ochs
> On Sep 18, 2015, at 8:37 AM, Brian King wrote: > On 09/16/2015 04:27 PM, Matthew R. Ochs wrote: >> >> /** >> + * drain_ioctls() - wait until all currently executing ioctls have completed >> + * @cfg:Internal structure associated with the host. >> +

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

2015-09-18 Thread Matthew R. Ochs
> On Sep 18, 2015, at 6:59 AM, Tomas Henzl wrote: > On 17.9.2015 19:16, Matthew R. Ochs wrote: >>> On Sep 17, 2015, at 7:38 AM, Tomas Henzl wrote: >>> >>> On 16.9.2015 18:53, Matthew R. Ochs wrote: >>>> Interrupt processing can run in parallel t

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

2015-09-18 Thread Matthew R. Ochs
> On Sep 17, 2015, at 8:26 PM, Brian King wrote: > > On 09/16/2015 04:27 PM, Matthew R. Ochs wrote: >> >> lun_access = kzalloc(sizeof(*lun_access), GFP_KERNEL); >> if (unlikely(!lun_access)) { >> dev_err(dev, "%s: Unabl

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

2015-09-17 Thread Matthew R. Ochs
> On Sep 17, 2015, at 7:38 AM, Tomas Henzl wrote: > > On 16.9.2015 18:53, Matthew R. Ochs wrote: >> Interrupt processing can run in parallel to a remove operation. This >> can lead to a condition where the interrupt handler is processing with >> memory that has

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

2015-09-17 Thread Matthew R. Ochs
> On Sep 17, 2015, at 6:58 AM, David Laight wrote: > > From: Linuxppc-dev Matthew R. Ochs >> Sent: 16 September 2015 22:28 >> Interrupt processing can run in parallel to a remove operation. This >> can lead to a condition where the interrupt handler is processing w

[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 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 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 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 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

<    1   2   3   4   5   >