[PATCH] target: Fix target_sense_desc_format NULL pointer dereference

2015-09-16 Thread Nicholas A. Bellinger
From: Nicholas Bellinger This patch allows target_sense_desc_format() to be called without a valid se_device pointer, which can occur during an early exception ahead of transport_lookup_cmd_lun() setting up se_cmd->se_device. This addresses a v4.3-rc1 specific NULL pointer

Re: [PATCH 08/17] Update the mmc driver to use idr helper functions.

2015-09-16 Thread Ulf Hansson
On 15 September 2015 at 18:46, Lee Duncan wrote: > Signed-off-by: Lee Duncan Please change the prefix of the commit message header to "mmc: core" and resend to linux-mmc. Kind regards Uffe > --- > drivers/mmc/core/host.c | 14 -- > 1 file

Re: [PATCH RESEND] csiostor:Fix error handling in the function csio_device_reset

2015-09-16 Thread Hannes Reinecke
On 09/16/2015 12:14 AM, Nicholas Krause wrote: > This fixes error handling in the function csio_device_reset to > check the return value of aftering the function csio_hw_reset > to check if it returned a error code and if so unlock the irq > spinlock for the hardware plus return the hardware error

Re: Why using configfs as the only interface is wrong for a storage target

2015-09-16 Thread Sergiu
Hello all, I have an issue related to this topic. I am trying to detect via a libudev wrapper if device based on configfs is mounted. I have a small usb detector based on libudev and libudev(the wapper), "udev_enumerate_add_match_subsystem( enumerate, "usb" )" is used as a filter and I mount

Re: [Bugfix 0/3] Convert eata driver to a normal PCI device driver

2015-09-16 Thread Arthur Marsh
Jiang Liu wrote on 16/09/15 14:37: On 2015/9/15 15:19, Arthur Marsh wrote: Jiang Liu wrote on 15/09/15 12:01: HI Arthur, Really appreciate your help to test the patches. That's a good sign we have moved forward a bit:) For kexec, it's always challenging to me. So could you

Re: [Bugfix 0/3] Convert eata driver to a normal PCI device driver

2015-09-16 Thread Jiang Liu
On 2015/9/16 15:37, Arthur Marsh wrote: > > > Jiang Liu wrote on 16/09/15 14:37: >> On 2015/9/15 15:19, Arthur Marsh wrote: >>> >>> >>> Jiang Liu wrote on 15/09/15 12:01: >>> HI Arthur, Really appreciate your help to test the patches. That's a good sign we have moved forward

Guten Tag,

2015-09-16 Thread ruizhenwu2000
Guten Tag, Ich wende mich an Sie zu einem Vorhaben gegenseitigen Nutzen für uns beide. Bei Interesse können Sie mir auf meine e-Mail unten, um weitere Informationen und Erklärung über das Telefon zu erreichen. E-Mail: ruizhenw...@gmail.com -- To unsubscribe from this list: send the line

Re: [PATCH 18/31] scsi/aic7xxx: use kmemdup rather than duplicating its implementation

2015-09-16 Thread Andrzej Hajda
Ping. Regards Andrzej On 08/07/2015 09:59 AM, Andrzej Hajda wrote: > The patch was generated using fixed coccinelle semantic patch > scripts/coccinelle/api/memdup.cocci [1]. > > [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 > > Signed-off-by: Andrzej Hajda >

Re: [PATCH 17/31] scsi/aacraid: use kmemdup rather than duplicating its implementation

2015-09-16 Thread Andrzej Hajda
Ping. Regards Andrzej On 08/07/2015 09:59 AM, Andrzej Hajda wrote: > The patch was generated using fixed coccinelle semantic patch > scripts/coccinelle/api/memdup.cocci [1]. > > [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 > > Signed-off-by: Andrzej Hajda >

Re: [PATCH 14/31] message/fusion: use kmemdup rather than duplicating its implementation

2015-09-16 Thread Andrzej Hajda
Ping. Regards Andrzej On 08/07/2015 09:59 AM, Andrzej Hajda wrote: > The patch was generated using fixed coccinelle semantic patch > scripts/coccinelle/api/memdup.cocci [1]. > > [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 > > Signed-off-by: Andrzej Hajda >

Re: [Bugfix 0/3] Convert eata driver to a normal PCI device driver

2015-09-16 Thread Arthur Marsh
Jiang Liu wrote on 16/09/15 17:51: Hi Arthur, It would be great if we could capture the text as in the picture posted by you at: http://www.users.on.net/~arthur.marsh/20150915547.jpg I guess a serial console could help us to capture those log messages. To use serial

Re: [PATCH] target: Fix target_sense_desc_format NULL pointer dereference

2015-09-16 Thread Sagi Grimberg
On 9/16/2015 9:31 AM, Nicholas A. Bellinger wrote: From: Nicholas Bellinger This patch allows target_sense_desc_format() to be called without a valid se_device pointer, which can occur during an early exception ahead of transport_lookup_cmd_lun() setting up

Re: [Bugfix 3/3] eata: Enhance eata driver to support PCI device hot-removal

2015-09-16 Thread Christoph Hellwig
On Mon, Sep 14, 2015 at 10:21:14AM +0200, Hannes Reinecke wrote: > Welll ... if you don't have hardware (and I strongly hope you refer to > 'hardware able to do hotplugging', not 'hardware for the eata driver' > ...) why add the code at all? > Chances are no-one will ever need eata PCI hotplug;

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

2015-09-16 Thread Christoph Hellwig
Hi Paolo, can you just move them to include/linux/ directly? Also scsi/scsi.h has some additional ioctl defintions that should be added to the UAPI scsi_ioctl.h. Otherwise this looks ok to me. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to

[PATCH] [SCSI] FlashPoint: fix build warning

2015-09-16 Thread Sudip Mukherjee
We have been getting a warning about non ANSI function. warning: non-ANSI function declaration of function 'FPT_SccbMgrTableInitAll' Signed-off-by: Sudip Mukherjee --- drivers/scsi/FlashPoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

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

2015-09-16 Thread Paolo Bonzini
On 16/09/2015 15:39, Christoph Hellwig wrote: > Hi Paolo, > > can you just move them to include/linux/ directly? I'm trying to cater to the objections that were made to Andy's patch. If you mean the non-UAPI headers, James wanted them to stay in scsi/; if you mean the UAPI headers, Douglas

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

2015-09-16 Thread Paolo Bonzini
On 16/09/2015 16:23, Christoph Hellwig wrote: > > I'm trying to cater to the objections that were made to Andy's patch. > > If you mean the non-UAPI headers, James wanted them to stay in scsi/; if > > you mean the UAPI headers, Douglas complained about the flat structure > > of include/linux/. >

Re: [PATCH] [SCSI] FlashPoint: fix build warning

2015-09-16 Thread Khalid Aziz
On 09/16/2015 08:06 AM, Sudip Mukherjee wrote: We have been getting a warning about non ANSI function. warning: non-ANSI function declaration of function 'FPT_SccbMgrTableInitAll' Signed-off-by: Sudip Mukherjee --- drivers/scsi/FlashPoint.c | 2 +- 1 file changed, 1

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

2015-09-16 Thread Christoph Hellwig
On Wed, Sep 16, 2015 at 04:15:46PM +0200, Paolo Bonzini wrote: > I'm trying to cater to the objections that were made to Andy's patch. > If you mean the non-UAPI headers, James wanted them to stay in scsi/; if > you mean the UAPI headers, Douglas complained about the flat structure > of

Possible Lock Dangling in function [fnic_handle_fip_timer] on [v4.3-rc1]

2015-09-16 Thread Ahmed Tamrawi
Hello: A possibility of a dangling lock and eventually a deadlock can occur in function [fnic_handle_fip_timer] on [v4.3-rc1]. Github Link: https://github.com/torvalds/linux/blob/v4.3-rc1/drivers/scsi/fnic/fnic_fcs.c#L1267 The lock acquired at line 1284 will not be unlocked upon function's

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

2015-09-16 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 v2 08/30] cxlflash: Fix to avoid CXL services during EEH

2015-09-16 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 v2 06/30] cxlflash: Fix to avoid sizeof(bool)

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

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

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

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

2015-09-16 Thread Matthew R. Ochs
The context encode mask covers more than 32-bits, making it a long integer. This should be noted by appending the ULL width suffix to the mask. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar ---

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

2015-09-16 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 v2 04/30] cxlflash: Fix potential oops following LUN removal

2015-09-16 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 v2 01/30] cxlflash: Fix to avoid invalid port_sel value

2015-09-16 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 v2 10/30] cxlflash: Correct naming of limbo state and waitq

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

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

2015-09-16 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 v2 09/30] cxlflash: Fix to stop interrupt processing on remove

2015-09-16 Thread Matthew R. Ochs
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 been freed. To avoid processing an interrupt while memory may be yanked, check for removal while in the interrupt handler. Bail when

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

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

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

2015-09-16 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 v2 13/30] cxlflash: Fix to avoid spamming the kernel log

2015-09-16 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 v2 15/30] cxlflash: Fix location of setting resid

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

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

2015-09-16 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 v2 14/30] cxlflash: Fix to avoid stall while waiting on TMF

2015-09-16 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 v2 17/30] cxlflash: Fix async interrupt bypass logic

2015-09-16 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 v2 18/30] cxlflash: Remove dual port online dependency

2015-09-16 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 v2 22/30] cxlflash: Correct behavior in device reset handler following EEH

2015-09-16 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 v2 20/30] cxlflash: Correct usage of scsi_host_put()

2015-09-16 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 v2 19/30] cxlflash: Fix AFU version access/storage and add check

2015-09-16 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 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 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

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

2015-09-16 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 v2 27/30] cxlflash: Correct spelling, grammar, and alignment mistakes

2015-09-16 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 v2 26/30] cxlflash: Fix to prevent EEH recovery failure

2015-09-16 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 v2 28/30] cxlflash: Fix to prevent stale AFU RRQ

2015-09-16 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 v2 29/30] cxlflash: Fix to avoid state change collision

2015-09-16 Thread Matthew R. Ochs
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 lack of a serialization mechanism to protect the adapter state. Use an adapter-wide mutex to serialize state changes. Signed-off-by:

[PATCH 16/17] Update the Micron PCIe SSD driver to use ida helper functions.

2015-09-16 Thread Lee Duncan
Signed-off-by: Lee Duncan --- drivers/block/mtip32xx/mtip32xx.c | 22 -- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 4a2ef09e6704..ccff4119b554 100644 ---

[PATCH 17/17] Update the ARM soc base driver to use ida helper functions.

2015-09-16 Thread Lee Duncan
Signed-off-by: Lee Duncan --- drivers/base/soc.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/base/soc.c b/drivers/base/soc.c index 39fca01c8fa1..cf70c3246123 100644 --- a/drivers/base/soc.c +++ b/drivers/base/soc.c @@ -122,18

[PATCH 15/17] Update the NVMe SSD driver to use ida helper functions.

2015-09-16 Thread Lee Duncan
Signed-off-by: Lee Duncan --- drivers/block/nvme-core.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index d1d6141920d3..ab13833d4fde 100644 --- a/drivers/block/nvme-core.c +++

[PATCH 02/17] Update scsi hosts to use idr for host number mgmt

2015-09-16 Thread Lee Duncan
Each Scsi_Host instance gets a host number starting at 0, but this was implemented with an atomic integer, and rollover wasn't considered. Another problem with this design is that scsi host numbers used by iscsi are never reused, thereby making rollover more likely. This patch converts Scsi_Host

[PATCH 00/17] Create and use ida and idr helper routines [RESEND]

2015-09-16 Thread Lee Duncan
[Apologies if you see this twice. I had to resend it.] The idr index management library supplies two sets of routines for managing monotonically increasing index numbers. The "ida" set of routines manage allocating and freeing simple index numbers. The "idr" set of routines add the ability to

Re: [PATCH 06/17] Update the infiniband uverbs driver to use idr helper functions.

2015-09-16 Thread Doug Ledford
On 09/16/2015 01:50 PM, Lee Duncan wrote: > Signed-off-by: Lee Duncan Looks OK to me. The setting of uobj->id is no longer under the lock, but we won't succeed at an idr lookup until it is set, which means it won't be found and can't be used in idr_remove_uobj() until after

[PATCH 11/17] Update the rtsx multifunction driver to use idr helper functions.

2015-09-16 Thread Lee Duncan
Signed-off-by: Lee Duncan --- drivers/mfd/rtsx_pcr.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/mfd/rtsx_pcr.c b/drivers/mfd/rtsx_pcr.c index a66540a49079..8ddefb8c5e64 100644 --- a/drivers/mfd/rtsx_pcr.c +++

[PATCH 09/17] Update the virtgpu driver to use idr helper functions.

2015-09-16 Thread Lee Duncan
Signed-off-by: Lee Duncan --- drivers/gpu/drm/virtio/virtgpu_vq.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c index 1698669f4185..380947dad306 100644 ---

[PATCH 01/17] Add ida and idr helper routines.

2015-09-16 Thread Lee Duncan
Clients of the ida and idr index-management routines tend to use the same calling sequences much of the time, so this change adds helper functions for allocating and releasing indexes of either flavor, i.e. with or without pointer management. Inline functions added for idr:

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

2015-09-16 Thread James Bottomley
Could you please add a cover letter (a 0/30) and thread your patches from that? For large patch series, it really does make following everything a lot easier for me (and most other people who use a threaded mail reader). Thanks, James -- To unsubscribe from this list: send the line

[PATCH 04/17] Update the ch driver to use idr helper functions.

2015-09-16 Thread Lee Duncan
Note: when allocating an index, in the error case, where the just-allocated index has to be released, the required locking around the index removal was not present, so this conversion has the side effect of adding locking for that error condition. This should close a possible race condition that

[PATCH 03/17] Update the st driver to use idr helper functions.

2015-09-16 Thread Lee Duncan
Signed-off-by: Lee Duncan --- drivers/scsi/st.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index b37b9b00c4b4..51e1ce721d9f 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -4265,11 +4265,8

[PATCH 05/17] Update the md driver to use idr helper functions.

2015-09-16 Thread Lee Duncan
Signed-off-by: Lee Duncan --- drivers/md/dm.c | 22 +- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index f331d888e7f5..53d6895eb13d 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2202,9 +2202,7 @@

[PATCH 07/17] Update the memstick driver to use idr helper functions.

2015-09-16 Thread Lee Duncan
Signed-off-by: Lee Duncan --- drivers/memstick/core/memstick.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/memstick/core/memstick.c b/drivers/memstick/core/memstick.c index a0547dbf9806..8f40a3d5108b 100644 ---

[PATCH 08/17] Update the mmc driver to use idr helper functions.

2015-09-16 Thread Lee Duncan
Signed-off-by: Lee Duncan --- drivers/mmc/core/host.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 99a9c9011c50..5aa2330f074c 100644 --- a/drivers/mmc/core/host.c +++

[PATCH 06/17] Update the infiniband uverbs driver to use idr helper functions.

2015-09-16 Thread Lee Duncan
Signed-off-by: Lee Duncan --- drivers/infiniband/core/uverbs_cmd.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index bbb02ffe87df..1e5b2a66a501 100644 ---

[PATCH 14/17] Update the rsxx flash adapter driver to use ida helper functions.

2015-09-16 Thread Lee Duncan
Signed-off-by: Lee Duncan --- drivers/block/rsxx/core.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/block/rsxx/core.c b/drivers/block/rsxx/core.c index d8b2488aaade..dd23a0e85040 100644 --- a/drivers/block/rsxx/core.c +++

[PATCH 13/17] Update the SCSI disk driver to use ida helper functions.

2015-09-16 Thread Lee Duncan
Signed-off-by: Lee Duncan --- drivers/scsi/sd.c | 20 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 3b2fcb4fada0..60b2ad918208 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2948,15

[PATCH 10/17] Update the DCA DMA driver to use idr helper functions.

2015-09-16 Thread Lee Duncan
Signed-off-by: Lee Duncan --- drivers/dca/dca-sysfs.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/dca/dca-sysfs.c b/drivers/dca/dca-sysfs.c index 126cf295b198..8930707df295 100644 --- a/drivers/dca/dca-sysfs.c +++

[PATCH 12/17] Update the TI Flash Media driver to use idr helper functions.

2015-09-16 Thread Lee Duncan
Signed-off-by: Lee Duncan --- drivers/misc/tifm_core.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/misc/tifm_core.c b/drivers/misc/tifm_core.c index a511b2a713b3..46385f828a8f 100644 --- a/drivers/misc/tifm_core.c +++

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

2015-09-16 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 v2 00/30] cxlflash: Miscellaneous bug fixes and corrections

2015-09-16 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 v2 10/30] cxlflash: Correct naming of limbo state and waitq

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

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

2015-09-16 Thread Matthew R. Ochs
The context encode mask covers more than 32-bits, making it a long integer. This should be noted by appending the ULL width suffix to the mask. Signed-off-by: Matthew R. Ochs Signed-off-by: Manoj N. Kumar ---

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

2015-09-16 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 v2 09/30] cxlflash: Fix to stop interrupt processing on remove

2015-09-16 Thread Matthew R. Ochs
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 been freed. To avoid processing an interrupt while memory may be yanked, check for removal while in the interrupt handler. Bail when

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

2015-09-16 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

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

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

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

2015-09-16 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 v2 29/30] cxlflash: Fix to avoid state change collision

2015-09-16 Thread Matthew R. Ochs
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 lack of a serialization mechanism to protect the adapter state. Use an adapter-wide mutex to serialize state changes. Signed-off-by:

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

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

2015-09-16 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 v2 14/30] cxlflash: Fix to avoid stall while waiting on TMF

2015-09-16 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 v2 15/30] cxlflash: Fix location of setting resid

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

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

2015-09-16 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 v2 17/30] cxlflash: Fix async interrupt bypass logic

2015-09-16 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 v2 18/30] cxlflash: Remove dual port online dependency

2015-09-16 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 v2 16/30] cxlflash: Fix host link up event handling

2015-09-16 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 v2 12/30] cxlflash: Refine host/device attributes

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

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

2015-09-16 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 v2 04/30] cxlflash: Fix potential oops following LUN removal

2015-09-16 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 v2 01/30] cxlflash: Fix to avoid invalid port_sel value

2015-09-16 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 v2 02/30] cxlflash: Replace magic numbers with literals

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

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

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

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

2015-09-16 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 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 Signed-off-by: Manoj N. Kumar Suggested-by: Brian King

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

2015-09-16 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 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
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

  1   2   >