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

2015-09-16 Thread Matthew R. Ochs
e used in sd.c) and rework the timeout literal to a more appropriate description. Signed-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Suggested-by: Brian King <brk...@linux.vnet.ibm.com> --- drivers/scsi/

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

2015-09-16 Thread Matthew R. Ochs
. This 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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Suggested-by: Brian King <brk...@linux.vnet.ibm.com> --- dri

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

2015-09-16 Thread Matthew R. Ochs
n from find_and_create_lun(), the value 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. Och

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

2015-09-16 Thread Matthew R. Ochs
From: Manoj Kumar <kuma...@us.ibm.com> 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 <mro...@linux.vnet.ibm.co

[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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/sup

[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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Suggested-by: Bri

[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 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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Suggested-by: Bri

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

2015-09-16 Thread Matthew R. Ochs
and consistency. Remove extra lines and a few unneeded variables/statements. Signed-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/common.h| 2 -- drivers/scsi/cxlflash/main

[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 21/30] cxlflash: Fix to prevent workq from accessing freed memory

2015-09-16 Thread Matthew R. Ochs
() as there is not a need to process any scheduled work when shutting down. Signed-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

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

2015-09-16 Thread Matthew R. Ochs
on 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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> --- drivers/s

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

2015-09-16 Thread Matthew R. Ochs
for 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 <

[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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 310da42..b0

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 <david.lai...@aculab.com> 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 th

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 <the...@redhat.com> 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 &g

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 <andrew.donnel...@au1.ibm.com> > 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

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 <andrew.donnel...@au1.ibm.com> > 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 @@ s

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 <d...@axtens.net> wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > "Matthew R. Ochs" <mro...@linux.vnet.ibm.com> writes: > >> From: Manoj Kumar <ma...@linux.vnet.ibm.com> &g

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

2015-10-01 Thread Matthew R. Ochs
> On Sep 30, 2015, at 6:50 PM, Daniel Axtens wrote: > (resending to the list this time, apologies!) > >>> I'm not sure I fully understand the flow of this function, but it looks >>> like you set rc=0 regardless of how things actually go: is this ever >>> going to print a return

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

2015-10-01 Thread Matthew R. Ochs
Acked-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> -- 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

[PATCH v5 06/34] cxlflash: Fix to avoid sizeof(bool)

2015-10-01 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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Bri

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

2015-10-01 Thread Matthew R. Ochs
for 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 <

[PATCH v5 03/34] cxlflash: Fix read capacity timeout

2015-10-01 Thread Matthew R. Ochs
e used in sd.c) and rework the timeout literal to a more appropriate description. Signed-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/superpipe.

[PATCH v5 04/34] cxlflash: Fix potential oops following LUN removal

2015-10-01 Thread Matthew R. Ochs
. This 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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> --- dri

[PATCH v5 02/34] cxlflash: Replace magic numbers with literals

2015-10-01 Thread Matthew R. Ochs
From: Manoj Kumar <kuma...@us.ibm.com> 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 <mro...@linux.vnet.ibm.co

[PATCH v5 08/34] cxlflash: Fix to avoid CXL services during EEH

2015-10-01 Thread Matthew R. Ochs
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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kum

[PATCH v5 09/34] cxlflash: Correct naming of limbo state and waitq

2015-10-01 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 <mro...@linux.vnet.ibm.com> Signed-off-by: M

[PATCH v5 18/34] cxlflash: Fix AFU version access/storage and add check

2015-10-01 Thread Matthew R. Ochs
-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/common.h | 2 +- drivers/scsi/cxlflash/main.c| 18 -- drivers/scsi/cxlfl

[PATCH v5 12/34] cxlflash: Fix to avoid spamming the kernel log

2015-10-01 Thread Matthew R. Ochs
'. The following changes were made: - pr_debug to pr_devel - pr_debug to pr_debug_ratelimited - pr_err to dev_err - pr_debug to dev_dbg Signed-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Bri

[PATCH v5 15/34] cxlflash: Fix host link up event handling

2015-10-01 Thread Matthew R. Ochs
-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> Conflicts: drivers/scsi/cxlflash/common.h --- drivers/scsi/cxlflash/common.h | 1 + drivers/scsi/cxlf

[PATCH v5 23/34] cxlflash: Fix function prolog parameters and return codes

2015-10-01 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 v5 21/34] cxlflash: Correct behavior in device reset handler following EEH

2015-10-01 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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Bri

[PATCH v5 14/34] cxlflash: Fix location of setting resid

2015-10-01 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 <

[PATCH v5 13/34] cxlflash: Fix to avoid stall while waiting on TMF

2015-10-01 Thread Matthew R. Ochs
such that a bigger hammer reset can occur. Signed-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/common.h | 1 + drivers/scsi/cxlf

[PATCH v5 16/34] cxlflash: Fix async interrupt bypass logic

2015-10-01 Thread Matthew R. Ochs
-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/cxlflash/mai

[PATCH v5 17/34] cxlflash: Remove dual port online dependency

2015-10-01 Thread Matthew R. Ochs
behavior needs to be altered again in the near future based on testing. Signed-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> --- drivers/scsi/cx

[PATCH v5 28/34] MAINTAINERS: Add cxlflash driver

2015-10-01 Thread Matthew R. Ochs
Add stanza for cxlflash SCSI driver. Signed-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <andrew.donnel...@au1.ibm.com&

[PATCH v5 25/34] cxlflash: Fix to prevent EEH recovery failure

2015-10-01 Thread Matthew R. Ochs
. 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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Bri

[PATCH v5 34/34] cxlflash: Fix to escalate to LINK_RESET on login timeout

2015-10-01 Thread Matthew R. Ochs
From: Manoj Kumar A 'login timed out' asynchronous error interrupt is generated if no response is seen to a FLOGI within 2 seconds. If the time out error is not escalated to a LINK_RESET the port will not be available for use. This fix provides the required escalation.

[PATCH v5 26/34] cxlflash: Correct spelling, grammar, and alignment mistakes

2015-10-01 Thread Matthew R. Ochs
and consistency. Remove extra lines and a few unneeded variables/statements. Signed-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <andrew.

[PATCH v5 27/34] cxlflash: Fix to prevent stale AFU RRQ

2015-10-01 Thread Matthew R. Ochs
after each reset. Signed-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> Reviewed-by: Daniel Axtens <d...@axtens.net> --- drivers/scsi/cxlflash/main.c | 3 +++ 1 fi

[PATCH v5 31/34] cxlflash: Correct trace string

2015-10-01 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 <brk...@linux.vnet.ibm.com> Signed-off-by: Matthew R. Och

[PATCH v5 30/34] cxlflash: Fix to avoid corrupting adapter fops

2015-10-01 Thread Matthew R. Ochs
R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <andrew.donnel...@au1.ibm.com> Reviewed-by: Daniel Axtens <d...@axtens.net> --- drivers/

[PATCH v5 24/34] cxlflash: Fix MMIO and endianness errors

2015-10-01 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 v5 00/34] cxlflash: Miscellaneous bug fixes and corrections

2015-10-01 Thread Matthew R. Ochs
to avoid invalid port_sel value cxlflash: Replace magic numbers with literals cxlflash: Fix read capacity timeout cxlflash: Fix to double the delay each time cxlflash: Fix to escalate to LINK_RESET on login timeout Matthew R. Ochs (29): cxlflash: Fix potential oops following LUN removal c

[PATCH v5 01/34] cxlflash: Fix to avoid invalid port_sel value

2015-10-01 Thread Matthew R. Ochs
n from find_and_create_lun(), the value 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. Och

[PATCH v5 10/34] cxlflash: Make functions static

2015-10-01 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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vne

[PATCH v5 11/34] cxlflash: Refine host/device attributes

2015-10-01 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 <shane.seym...@hp.com> Signed-off-by: Matthew R. Ochs <mro...@linux.vne

[PATCH v5 07/34] cxlflash: Fix context encode mask width

2015-10-01 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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Bri

[PATCH v5 33/34] cxlflash: Fix to avoid leaving dangling interrupt resources

2015-10-01 Thread Matthew R. Ochs
and the appropriate goto is added to each error path. As a mini side fix while refactoring in this routine, the else statement following the AFU version evaluation is eliminated as it is not needed. Signed-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/main.

[PATCH v5 19/34] cxlflash: Correct usage of scsi_host_put()

2015-10-01 Thread Matthew R. Ochs
on 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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Bri

[PATCH v5 20/34] cxlflash: Fix to prevent workq from accessing freed memory

2015-10-01 Thread Matthew R. Ochs
() as there is not a need to process any scheduled work when shutting down. Signed-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/main.c | 2 +-

[PATCH v5 22/34] cxlflash: Remove unnecessary scsi_block_requests

2015-10-01 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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Bri

[PATCH v5 29/34] cxlflash: Fix to double the delay each time

2015-10-01 Thread Matthew R. Ochs
From: Manoj Kumar <ma...@linux.vnet.ibm.com> The operator used to double the master context response 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 <the...@redhat.com> Signed-off-by: Matthew

Re: [PATCH v5 34/34] cxlflash: Fix to escalate to LINK_RESET on login timeout

2015-10-01 Thread Matthew R. Ochs
Acked-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> -- 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 v5 18/34] cxlflash: Fix AFU version access/storage and add check

2015-10-01 Thread Matthew R. Ochs
> On Oct 1, 2015, at 7:56 PM, Daniel Axtens <d...@axtens.net> wrote: > > "Matthew R. Ochs" <mro...@linux.vnet.ibm.com> writes: > >> The AFU version is stored as a non-terminated string of bytes within >> a 64-bit little-endian register. Presently t

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

2015-10-02 Thread Matthew R. Ochs
Hi James, This series has been fairly well vetted. With cxlflash being a new driver the majority of these patches fix critical bugs. Is there anything else you're looking for in order to get this set pulled into 4.3-rc? -matt > On Oct 1, 2015, at 10:52 AM, Matthew R. Ochs &

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

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 <brk...@linux.vnet.ibm.com> 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, >>

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

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 <d...@axtens.net> wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > "Matthew R. Ochs" <mro...@linux.vnet.ibm.com> writes: > > >> The process_sense() routine can perform a r

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 <d...@axtens.net> wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > "Matthew R. Ochs" <mro...@linux.vnet.ibm.com> writes: > >> Following an adapter reset, the AFU RRQ that resides

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 <brk...@linux.vnet.ibm.com> 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) >> +

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 <the...@redhat.com> wrote: > On 17.9.2015 19:16, Matthew R. Ochs wrote: >>> On Sep 17, 2015, at 7:38 AM, Tomas Henzl <the...@redhat.com> wrote: >>> >>> On 16.9.2015 18:53, Matthew R. Ochs wrote: >>>

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 <brk...@linux.vnet.ibm.com> wrote: > On 09/16/2015 04:27 PM, Matthew R. Ochs wrote: >> >> /** >> + * drain_ioctls() - wait until all currently executing ioctls have completed >> + * @cfg:Interna

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 <the...@redhat.com> 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

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 <the...@redhat.com> 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. >>

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 <brk...@linux.vnet.ibm.com> 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 >> inter

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 <brk...@linux.vnet.ibm.com> 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 f

[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

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

2015-09-24 Thread Matthew R. Ochs
R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/main.c | 23 --- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/dri

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

2015-09-24 Thread Matthew R. Ochs
for 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 <

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

[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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Bri

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

2015-09-24 Thread Matthew R. Ochs
From: Manoj Kumar <kuma...@us.ibm.com> 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 <mro...@linux.vnet.ibm.co

[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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kum

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

2015-09-24 Thread Matthew R. Ochs
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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kum

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 <mro...@linux.vnet.ibm.com> > wrote: > > Implement the following suggestions and add two new attributes > to allow for debugging the port LUN table.

[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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --g

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

2015-09-24 Thread Matthew R. Ochs
-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> --- 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/

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

2015-09-24 Thread Matthew R. Ochs
From: Manoj Kumar <ma...@linux.vnet.ibm.com> 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 <the...@redhat.com> Signed-off-by: Matthew R. Ochs <mro...@lin

[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 <brk...@linux.vnet.ibm.com> Signed-off-by: Matthew R. Och

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

2015-09-24 Thread Matthew R. Ochs
n from find_and_create_lun(), the value 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. Och

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

2015-09-24 Thread Matthew R. Ochs
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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kum

[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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Bri

[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
on 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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> --- drivers/s

[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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Bri

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

2015-09-24 Thread Matthew R. Ochs
() as there is not a need to process any scheduled work when shutting down. Signed-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/common.h | 2 +- drivers/scsi/cxlflash/main.c| 18 -- drivers/scsi/cxlfl

[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 <mro...@linux.vnet.ibm.com> Signed-off-by: M

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

2015-09-24 Thread Matthew R. Ochs
. This 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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/supe

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

2015-09-24 Thread Matthew R. Ochs
e used in sd.c) and rework the timeout literal to a more appropriate description. Signed-off-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/superpipe.

[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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> Conflicts: drivers/sc

[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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/common.h | 1 + drivers/scsi/cxlflash/main.c | 55 +- 2 files

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

2015-09-24 Thread Matthew R. Ochs
-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> Conflicts: drivers/scsi/cxlflash/common.h --- drivers/scsi/cxlflash/common.h | 1 + drivers/scsi/cxlf

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

2015-09-24 Thread Matthew R. Ochs
-by: Matthew R. Ochs <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vnet.ibm.com> Reviewed-by: Brian King <brk...@linux.vnet.ibm.com> --- drivers/scsi/cxlflash/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/cxlflash/mai

[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 <mro...@linux.vnet.ibm.com> Signed-off-by: Manoj N. Kumar <ma...@linux.vne

<    1   2   3   4   5   >