[PATCH 3/4] Scsi: dc395x.c: Use module_pci_driver

2015-09-25 Thread Shraddha Barke
Use module_pci_driver for drivers whose init and exit functions only register and unregister respectively Signed-off-by: Shraddha Barke --- drivers/scsi/dc395x.c | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --git

[PATCH 4/4] Scsi: a100u2w.c: Use module_pci_driver

2015-09-25 Thread Shraddha Barke
Use module_pci_driver for drivers whose init and exit functions only register and unregister respectively Signed-off-by: Shraddha Barke --- drivers/scsi/a100u2w.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/scsi/a100u2w.c

[PATCH 1/4] Scsi: am53c974.c: Use module_pci_driver

2015-09-25 Thread Shraddha Barke
Use module_pci_driver for drivers whose init and exit functions only register and unregister respectively Signed-off-by: Shraddha Barke --- drivers/scsi/am53c974.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/scsi/am53c974.c

Re: [PATCH v3 0/4] scsi: cleanup ioctl headers and provide UAPI versions

2015-09-25 Thread Christoph Hellwig
The whole series looks good to me. Thanks for picking this work up! Reviewed-by: Christoph Hellwig -- 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

Re: Bugs in multipath scsi in 4.3-rc2

2015-09-25 Thread Christoph Hellwig
Hi Paul, can you send the request_module fix as a proper signed off and described patch? I'll figure out what w can do about async scan vs request_module in the meantime. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to

Re: [PATCH 1/4] Scsi: am53c974.c: Use module_pci_driver

2015-09-25 Thread Hannes Reinecke
On 09/25/2015 05:08 PM, Shraddha Barke wrote: > Use module_pci_driver for drivers whose init and exit functions > only register and unregister respectively > > Signed-off-by: Shraddha Barke > --- > drivers/scsi/am53c974.c | 14 +- > 1 file changed, 1

Re: Bugs in multipath scsi in 4.3-rc2

2015-09-25 Thread Bart Van Assche
On 09/25/2015 05:16 AM, Paul Mackerras wrote: diff --git a/drivers/scsi/scsi_dh.c b/drivers/scsi/scsi_dh.c index edb044a..86a3063 100644 --- a/drivers/scsi/scsi_dh.c +++ b/drivers/scsi/scsi_dh.c @@ -111,7 +111,7 @@ static struct scsi_device_handler *scsi_dh_lookup(const char *name) dh

Re: [PATCH v3 4/4] scsi: provide UAPI version of scsi/sg.h and scsi/scsi_ioctl.h

2015-09-25 Thread Bart Van Assche
On 09/25/2015 02:28 AM, Paolo Bonzini wrote: Provide a UAPI version of the header in the kernel, making it easier for interested projects to use an up-to-date version of the header. The new headers are placed under uapi/linux/ so as not to conflict with the glibc-provided headers in

Re: [PATCH 2/4] Scsi: dmx3191d.c: Use module_pci_driver

2015-09-25 Thread Hannes Reinecke
On 09/25/2015 05:08 PM, Shraddha Barke wrote: > Use module_pci_driver for drivers whose init and exit functions > only register and unregister respectively > > Signed-off-by: Shraddha Barke > --- > drivers/scsi/dmx3191d.c | 14 +- > 1 file changed, 1

Re: [PATCH 3/4] Scsi: dc395x.c: Use module_pci_driver

2015-09-25 Thread Hannes Reinecke
On 09/25/2015 05:08 PM, Shraddha Barke wrote: > Use module_pci_driver for drivers whose init and exit functions > only register and unregister respectively > > Signed-off-by: Shraddha Barke > --- > drivers/scsi/dc395x.c | 25 + > 1 file changed,

[PATCH 2/4] Scsi: dmx3191d.c: Use module_pci_driver

2015-09-25 Thread Shraddha Barke
Use module_pci_driver for drivers whose init and exit functions only register and unregister respectively Signed-off-by: Shraddha Barke --- drivers/scsi/dmx3191d.c | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/scsi/dmx3191d.c

Re: [PATCH 4/4] Scsi: a100u2w.c: Use module_pci_driver

2015-09-25 Thread Hannes Reinecke
On 09/25/2015 05:08 PM, Shraddha Barke wrote: > Use module_pci_driver for drivers whose init and exit functions > only register and unregister respectively > > Signed-off-by: Shraddha Barke > --- > drivers/scsi/a100u2w.c | 14 +- > 1 file changed, 1

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Johannes Berg
On Fri, 2015-09-25 at 09:41 -0700, Viresh Kumar wrote: > Signed-off-by: Viresh Kumar > --- > V3->V4: > - Create a local variable instead of changing type of global_lock > (Rafael) Err, surely that wasn't what Rafael meant, since it's clearly impossible to use a

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

2015-09-25 Thread Brian King
Reviewed-by: Brian King -- Brian King Power Linux I/O IBM Linux Technology Center -- 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

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

2015-09-25 Thread Brian King
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 set fileops */ > - if (atomic_read(>num_user_contexts) == 0) > + /* On very first attach set fileops for

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Viresh Kumar
On 25-09-15, 22:58, Rafael J. Wysocki wrote: > Say you have three adjacent fields in a structure, x, y, z, each one byte > long. > Initially, all of them are equal to 0. > > CPU A writes 1 to x and CPU B writes 2 to y at the same time. > > What's the result? But then two CPUs can update the

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Viresh Kumar
On 25 September 2015 at 13:33, Rafael J. Wysocki wrote: > You're going to change that into bool in the next patch, right? Yeah. > So what if bool is a byte and the field is not word-aligned Its between two 'unsigned long' variables today, and the struct isn't packed. So, it

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Rafael J. Wysocki
On Friday, September 25, 2015 01:25:49 PM Viresh Kumar wrote: > On 25 September 2015 at 13:33, Rafael J. Wysocki wrote: > > You're going to change that into bool in the next patch, right? > > Yeah. > > > So what if bool is a byte and the field is not word-aligned > > Its

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

2015-09-25 Thread Brian King
Reviewed-by: Brian King -- Brian King Power Linux I/O IBM Linux Technology Center -- 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

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

2015-09-25 Thread Brian King
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/scsi/cxlflash/main.c > @@ -496,6 +496,7 @@ static int cxlflash_queuecommand(struct

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

2015-09-25 Thread Brian King
Reviewed-by: Brian King -- Brian King Power Linux I/O IBM Linux Technology Center -- 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

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

2015-09-25 Thread Brian King
Reviewed-by: Brian King -- Brian King Power Linux I/O IBM Linux Technology Center -- 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

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

2015-09-25 Thread Brian King
Reviewed-by: Brian King -- Brian King Power Linux I/O IBM Linux Technology Center -- 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

Re: Bugs in multipath scsi in 4.3-rc2

2015-09-25 Thread James Bottomley
On Fri, 2015-09-25 at 17:18 +0200, Christoph Hellwig wrote: > Hi Paul, > > can you send the request_module fix as a proper signed off and described > patch? I'll figure out what w can do about async scan vs request_module > in the meantime. So the warning seems to be because

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Viresh Kumar
On 25-09-15, 19:42, Johannes Berg wrote: > On Fri, 2015-09-25 at 09:41 -0700, Viresh Kumar wrote: > > > Signed-off-by: Viresh Kumar > > --- > > V3->V4: > > - Create a local variable instead of changing type of global_lock > > (Rafael) > > Err, surely that wasn't what

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Rafael J. Wysocki
On Friday, September 25, 2015 09:41:37 AM Viresh Kumar wrote: > global_lock is defined as an unsigned long and accessing only its lower > 32 bits from sysfs is incorrect, as we need to consider other 32 bits > for big endian 64 bit systems. There are no such platforms yet, but the > code needs to

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Rafael J. Wysocki
On Friday, September 25, 2015 10:18:13 PM Rafael J. Wysocki wrote: > On Friday, September 25, 2015 09:41:37 AM Viresh Kumar wrote: > > global_lock is defined as an unsigned long and accessing only its lower > > 32 bits from sysfs is incorrect, as we need to consider other 32 bits > > for big

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Viresh Kumar
On 25-09-15, 20:49, Johannes Berg wrote: > Ok, then, but that means Rafael is completely wrong ... > debugfs_create_bool() takes a *pointer* and it needs to be long-lived, > it can't be on the stack. You also don't get a call when it changes. Ahh, ofcourse. My bad as well... I think we can

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Rafael J. Wysocki
On Friday, September 25, 2015 11:52:56 AM Viresh Kumar wrote: > On 25-09-15, 20:49, Johannes Berg wrote: > > Ok, then, but that means Rafael is completely wrong ... > > debugfs_create_bool() takes a *pointer* and it needs to be long-lived, > > it can't be on the stack. You also don't get a call

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Johannes Berg
> Rafael wrote: > > Actually, what about adding a local u32 variable, say val, here and > > doing > > > > > if (!debugfs_create_x32("gpe", 0444, dev_dir, (u32 > > > *)_ec->gpe)) > > > goto error; > > > if (!debugfs_create_bool("use_global_lock", 0444, > > > dev_dir, > > > -

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Rafael J. Wysocki
On Friday, September 25, 2015 10:26:22 PM Rafael J. Wysocki wrote: > On Friday, September 25, 2015 11:52:56 AM Viresh Kumar wrote: > > On 25-09-15, 20:49, Johannes Berg wrote: > > > Ok, then, but that means Rafael is completely wrong ... > > > debugfs_create_bool() takes a *pointer* and it needs

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

[PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Viresh Kumar
global_lock is defined as an unsigned long and accessing only its lower 32 bits from sysfs is incorrect, as we need to consider other 32 bits for big endian 64 bit systems. There are no such platforms yet, but the code needs to be robust for such a case. Fix that by passing a local variable to

[PATCH V4 2/2] debugfs: Pass bool pointer to debugfs_create_bool()

2015-09-25 Thread Viresh Kumar
Its a bit odd that debugfs_create_bool() takes 'u32 *' as an argument, when all it needs is a boolean pointer. It would be better to update this API to make it accept 'bool *' instead, as that will make it more consistent and often more convenient. Over that bool takes just a byte (mostly). That

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 set fileops */ >> -if

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

2015-09-25 Thread Matthew R. Ochs
This patch set contains various fixes and corrections for issues that were found during test and code review. The series is based upon the code upstreamed in 4.3 and is intended for the rc phase. The entire set is bisectable. Please reference the changelog below for details on what has been

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

2015-09-25 Thread Matthew R. Ochs
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 and use the appropriate wait services. Also add a timeout while waiting for a TMF completion. When a TMF times out, report back a failure such

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

2015-09-25 Thread Matthew R. Ochs
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 mode. Additionally, numerous prints can be converted to trace the corresponding device. The following changes were made: - pr_debug to pr_devel

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

2015-09-25 Thread Matthew R. Ochs
A bug was introduced earlier in the development cycle when cleaning up logic statements. Instead of skipping bits that are not set, set bits are skipped, causing async interrupts to not be handled correctly. To fix, simply add back in the proper evaluation for an unset bit. Signed-off-by:

[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

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

2015-09-25 Thread Matthew R. Ochs
Following a link up event, the LUNs available to the host may have changed. Without rescanning the host, the LUN topology is unknown to the user. In such a state, the user would be unable to locate provisioned resources. To remedy, the host should be rescanned after a link up event.

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

2015-09-25 Thread Matthew R. Ochs
The AFU version is stored as a non-terminated string of bytes within a 64-bit little-endian register. Presently the value is read directly (no MMIO accessor) and is stored in a buffer that is not big enough to contain a NULL terminator. Additionally the version obtained is not evaluated against a

[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

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

2015-09-25 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, as a refactoring measure, change the return code variable name to match that used throughout the driver. Signed-off-by: Matthew

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

2015-09-25 Thread Matthew R. Ochs
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 being freed too early with subsequent access potentially corrupting data whilst the former would result in a memory leak. Move the usage on

[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

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

2015-09-25 Thread Matthew R. Ochs
The fops owned by the adapter can be corrupted in certain scenarios, opening a window where certain fops are temporarily NULLed before being reset to their proper value. This can potentially lead software to make incorrect decisions, leaving the user with the inability to function as intended. An

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

[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

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

2015-09-25 Thread Matthew R. Ochs
From: Manoj Kumar If two concurrent MANAGE_LUN ioctls are issued with the same WWID parameter, it would result in an incorrect value of port_sel. This is because port_sel is modified without any locks being held. If the first caller stalls after the return from

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

2015-09-25 Thread Matthew R. Ochs
Following an adapter reset, the AFU RRQ that resides in host memory holds stale data. This can lead to a condition where the RRQ interrupt handler tries to process stale entries and/or endlessly loops due to an out of sync generation bit. To fix, the AFU RRQ in host memory needs to be cleared

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

2015-09-25 Thread Matthew R. Ochs
The process_sense() routine can perform a read capacity which can take some time to complete. If an EEH occurs while waiting on the read capacity, the EEH handler is unable to obtain the context's mutex in order to put the context in an error state. The EEH handler will sit and wait until the

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

2015-09-25 Thread Matthew R. Ochs
There are several spelling and grammar mistakes throughout the driver. Additionally there are a handful of places where there are extra lines and unnecessary variables/statements. These are a nuisance and pollute the driver. Fix spelling and grammar issues. Update some comments for clarity and

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

2015-09-25 Thread Matthew R. Ochs
When the device reset handler is entered while a reset operation is taking place, the handler exits without actually sending a reset (TMF) to the targeted device. This behavior is incorrect as the device is not reset. Further complicating matters is the fact that a success is returned even when

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

2015-09-25 Thread Matthew R. Ochs
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 should be terminated prior to freeing memory. Move the termination call earlier in remove and use cancel_work_sync() instead of flush_work() as

[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

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

2015-09-25 Thread Matthew R. Ochs
Ioctl threads that use scsi_execute() can run for an excessive amount of time due to the fact that they have lengthy timeouts and retry logic built in. Under normal operation this is not an issue. However, once EEH enters the picture, a long execution time coupled with the possibility that a

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Rafael J. Wysocki
On Fri, Sep 25, 2015 at 11:44 PM, Viresh Kumar wrote: > On 25-09-15, 22:58, Rafael J. Wysocki wrote: >> Say you have three adjacent fields in a structure, x, y, z, each one byte >> long. >> Initially, all of them are equal to 0. >> >> CPU A writes 1 to x and CPU B writes

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

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

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

2015-09-25 Thread Matthew R. Ochs
Found during code inspection, that the following functions are not being used outside of the file where they are defined. Make them static. int cxlflash_send_cmd(struct afu *, struct afu_cmd *); void cxlflash_wait_resp(struct afu *, struct afu_cmd *); int cxlflash_afu_reset(struct cxlflash_cfg

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

2015-09-25 Thread Matthew R. Ochs
During an EEH freeze event, certain CXL services should not be called until after the hardware reset has taken place. Doing so can result in unnecessary failures and possibly cause other ill effects by triggering hardware accesses. This translates to a requirement to quiesce all threads that may

[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

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

2015-09-25 Thread Matthew R. Ochs
If the same virtual LUN is accessed over multiple cards, only accesses made over the first card will be valid. Accesses made over the second card will go to the wrong LUN causing data corruption. This is because the global LUN's mode word was being used to determine whether the LUN table for that

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

2015-09-25 Thread Matthew R. Ochs
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 timeout. Additionally the literal used for the timeout is stale. Update the timeout to 30 seconds (matches the value used in

[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

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

2015-09-25 Thread Matthew R. Ochs
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 while a context is still associated with it, obtain an additional reference per-context for each LUN attached to the context. This

[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

Re: [PATCH v3 2/4] scsi: cleanup scsi/scsi_ioctl.h

2015-09-25 Thread Hannes Reinecke
On 09/25/2015 11:27 AM, Paolo Bonzini wrote: > SCSI_REMOVAL_* goes together with other SCSI command constants in > include/scsi/scsi.h. It is also used outside the implementation > of the ioctls (and it is not part of the user API). > > scsi_fctargaddress/Scsi_FCTargAddress has had no in-tree

Re: [PATCH v3 1/4] scsi: remove old-style type names from sg.h

2015-09-25 Thread Hannes Reinecke
On 09/25/2015 11:27 AM, Paolo Bonzini wrote: > These will not be exported by the new linux/sg.h header, and scsi/sg.h will > not have any user API after linux/sg.h is created. Since they have no > user in the kernel, they can be zapped. > > Cc: James Bottomley > Cc:

[PATCH] scsi_dh: Use the correct module name when loading device handler

2015-09-25 Thread Paul Mackerras
This fixes a bug in recent kernels which results in failure to boot on systems that have multipath SCSI disks. I observed this failure on a POWER8 server where all the disks are multipath SCSI disks. The symptoms are several messages like this on the console: [3.018700] device-mapper: table:

Re: [PATCH v3 3/4] scsi: move all obsolete ioctls to scsi_ioctl.h

2015-09-25 Thread Hannes Reinecke
On 09/25/2015 11:27 AM, Paolo Bonzini wrote: > Some are in scsi.h. Keep them together in preparation for exposing them > in UAPI headers. > > Cc: James Bottomley > Cc: Christoph Hellwig > Cc: linux-scsi@vger.kernel.org > Reviewed-by: Bart Van Assche

Re: [PATCH v3 4/4] scsi: provide UAPI version of scsi/sg.h and scsi/scsi_ioctl.h

2015-09-25 Thread Hannes Reinecke
On 09/25/2015 11:27 AM, Paolo Bonzini wrote: > Provide a UAPI version of the header in the kernel, making it easier > for interested projects to use an up-to-date version of the header. > > The new headers are placed under uapi/linux/ so as not to conflict > with the glibc-provided headers in

Re: [PATCH] scsi_dh: Use the correct module name when loading device handler

2015-09-25 Thread Hannes Reinecke
On 09/26/2015 02:19 AM, Paul Mackerras wrote: > This fixes a bug in recent kernels which results in failure to boot > on systems that have multipath SCSI disks. I observed this failure > on a POWER8 server where all the disks are multipath SCSI disks. > The symptoms are several messages like this

Re: [PATCH v2 4/4] scsi: provide UAPI version of scsi/sg.h and scsi/scsi_ioctl.h

2015-09-25 Thread Paolo Bonzini
On 17/09/2015 17:32, Bart Van Assche wrote: > >> + >> +#ifndef __KERNEL__ >> +/* Keep in sync with SG_DEFAULT_TIMEOUT of scsi/sg.h */ >> #define SG_DEFAULT_TIMEOUT(60*HZ) /* HZ == 'jiffies in 1 >> second' */ >> #endif > > Is it useful and/or necessary to export this constant ?

[PATCH v2] scsi_debug: fix failure to probe with scsi_level=1 or 2 due to NULL devip

2015-09-25 Thread Ewan D. Milne
From: "Ewan D. Milne" commit cbf67842c3d9 ("scsi_debug: support scsi-mq, queues and locks") added a test for devip == NULL in schedule_resp which returned SCSI_MLQUEUE_HOST_BUSY. However, devip will be NULL for any SCSI command to a LUN above the configured value, and if

Bugs in multipath scsi in 4.3-rc2

2015-09-25 Thread Paul Mackerras
I recently tried v4.3-rc2 on a test machine I have which is a POWER8 server with multipath SCSI disks. It failed to boot because it didn't find its disks. Two things were evident in the logs: first, we're hitting a WARN_ON_ONCE in the module code: [1.953020] WARNING: at

Re: Question about expected behavior of terminate_rport_io() in fc_function_template

2015-09-25 Thread Benjamin Block
Hej Hannes, thx for the short explanation. On 23:05 Wed 23 Sep , Hannes Reinecke wrote: > On 09/23/2015 07:06 PM, Benjamin Block wrote: > > Hello, > > > > just a short question. If a low-level driver implements the function > > `terminate_rport_io()` in `struct fc_function_template`, and it

[PATCH v3 4/4] scsi: provide UAPI version of scsi/sg.h and scsi/scsi_ioctl.h

2015-09-25 Thread Paolo Bonzini
Provide a UAPI version of the header in the kernel, making it easier for interested projects to use an up-to-date version of the header. The new headers are placed under uapi/linux/ so as not to conflict with the glibc-provided headers in /usr/include/scsi. /dev/sgN default values are

[PATCH v3 2/4] scsi: cleanup scsi/scsi_ioctl.h

2015-09-25 Thread Paolo Bonzini
SCSI_REMOVAL_* goes together with other SCSI command constants in include/scsi/scsi.h. It is also used outside the implementation of the ioctls (and it is not part of the user API). scsi_fctargaddress/Scsi_FCTargAddress has had no in-tree use since commit ca61f10ab2b8 ("[SCSI] remove broken

[PATCH v3 0/4] scsi: cleanup ioctl headers and provide UAPI versions

2015-09-25 Thread Paolo Bonzini
This is v3 of the series to provide an "official" sg.h header (and scsi_ioctl.h too, though it's basically obsolete) together with the other userspace API definitions. The change from v2 to v3 is that defaults for sg.c are not exported in include/uapi/linux/sg.c. Paolo 2.5.0 -- To unsubscribe

[PATCH v3 1/4] scsi: remove old-style type names from sg.h

2015-09-25 Thread Paolo Bonzini
These will not be exported by the new linux/sg.h header, and scsi/sg.h will not have any user API after linux/sg.h is created. Since they have no user in the kernel, they can be zapped. Cc: James Bottomley Cc: Christoph Hellwig Cc:

[PATCH v3 3/4] scsi: move all obsolete ioctls to scsi_ioctl.h

2015-09-25 Thread Paolo Bonzini
Some are in scsi.h. Keep them together in preparation for exposing them in UAPI headers. Cc: James Bottomley Cc: Christoph Hellwig Cc: linux-scsi@vger.kernel.org Reviewed-by: Bart Van Assche Signed-off-by: Paolo Bonzini