Re: SCSI: race condition between scsi_remove_target and scsi_probe_and_add_lun

2015-10-23 Thread Alexey Ivanov
+ linux-scsi > On Mar 20, 2014, at 6:42 PM, Andrey Zonov wrote: > > Hi, > > I've got kernel panic on my box which works as FibreChannel initiator. > I was able to reproduce this panic by setting dev_loss_tmo=2 and > enabling/disabling ports every 5 seconds on the switch in 5 minutes. I > added

Re: [PATCH 2/2] scsi: remove useless casting value returned by kmalloc to structure

2015-10-23 Thread Matthew R. Ochs
Reviewed-by: Matthew R. Ochs -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/2] scsi: lpfc: Use kzalloc instead of kmalloc

2015-10-23 Thread Matthew R. Ochs
Hi Punit, Aren't you missing the removal of the memset() as part of this conversion? -matt > On Oct 23, 2015, at 3:03 PM, Punit Vara wrote: > > This patch is to the lpfc_els.c which resolves following warning > reported by coccicheck: > > WARNING: kzalloc should be used for rdp_context, inst

[PATCH 1/2] scsi: lpfc: Use kzalloc instead of kmalloc

2015-10-23 Thread Punit Vara
This patch is to the lpfc_els.c which resolves following warning reported by coccicheck: WARNING: kzalloc should be used for rdp_context, instead of kmalloc/memset Signed-off-by: Punit Vara --- drivers/scsi/lpfc/lpfc_els.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driv

[PATCH 2/2] scsi: remove useless casting value returned by kmalloc to structure

2015-10-23 Thread Punit Vara
This is the patch to the hpsa.c file that resolves following warning reported by coccicheck: WARNING: casting value returned by memory allocation function to (BIG_IOCTL_Command_struct *) is useless. Signed-off-by: Punit Vara --- drivers/scsi/hpsa.c | 3 +-- 1 file changed, 1 insertion(+), 2 del

[PATCH 0/2] Fix warning by coccicheck

2015-10-23 Thread Punit Vara
Punit Vara (2): scsi: lpfc: Use kzalloc instead of kmalloc scsi: remove useless casting value returned by kmalloc to structure drivers/scsi/hpsa.c | 3 +-- drivers/scsi/lpfc/lpfc_els.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) -- 2.5.3 -- To unsubscribe from this l

Re: [PATCH v4 11/11] scsi: ufs-exynos: add UFS host support for Exynos SoCs

2015-10-23 Thread Kishon Vijay Abraham I
Hi, On Thursday 15 October 2015 08:38 AM, Alim Akhtar wrote: > +CCing kishon Vijay, > > On 10/14/2015 06:25 PM, Alim Akhtar wrote: >> From: Seungwon Jeon >> >> This patch introduces Exynos UFS host controller driver, >> which mainly handles vendor-specific operations including >> link startup, p

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

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:16, Matthew R. Ochs wrote: > 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 provi

Re: [PATCH v6 33/37] cxlflash: Fix to avoid leaving dangling interrupt resources

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:16, Matthew R. Ochs wrote: > When running with an unsupported AFU, the cxlflash driver fails > the probe. When the driver is removed, the following Oops is > encountered on a show_interrupts() thread: > > Call Trace: > [c01fba5a7a10] [0003] 0x3 (unreliable) > [c

Re: [PATCH v6 31/37] cxlflash: Correct trace string

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:15, Matthew R. Ochs wrote: > 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: Matt

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

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:15, Matthew R. Ochs wrote: > 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 execu

Re: [PATCH v6 30/37] cxlflash: Fix to avoid corrupting adapter fops

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:15, Matthew R. Ochs wrote: > 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 u

Re: [PATCH v6 29/37] cxlflash: Fix to double the delay each time

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:15, Matthew R. Ochs wrote: > From: Manoj Kumar > > 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 > Signed-off-by: Matthew R

Re: [PATCH v6 27/37] cxlflash: Fix to prevent stale AFU RRQ

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:15, Matthew R. Ochs wrote: > 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 f

Re: [PATCH v6 26/37] cxlflash: Correct spelling, grammar, and alignment mistakes

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:15, Matthew R. Ochs wrote: > 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 g

Re: [PATCH v6 25/37] cxlflash: Fix to prevent EEH recovery failure

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > 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 will wait to obtain the > context's mutex in order to put the context in an error stat

Re: [PATCH v6 24/37] cxlflash: Fix MMIO and endianness errors

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > 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 driv

Re: [PATCH v6 23/37] cxlflash: Fix function prolog parameters and return codes

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > 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

Re: [PATCH v6 21/37] cxlflash: Correct behavior in device reset handler following EEH

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > 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

Re: [PATCH v6 22/37] cxlflash: Remove unnecessary scsi_block_requests

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > 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 Reviewed-by: Tomas He

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

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > The workq can process work in parallel with a remove event, leading > to a condition where the workq handler can access freed memory. > > To remedy, the workq should be terminated prior to freeing memory. Move > the termination call earlier in remove an

Re: [PATCH v6 19/37] cxlflash: Correct usage of scsi_host_put()

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > Currently, scsi_host_put() is being called prematurely in the > remove path and is missing entirely in an error cleanup path. > The former can lead to memory being freed too early with > subsequent access potentially corrupting data whilst the former >

Re: [PATCH v6 18/37] cxlflash: Fix AFU version access/storage and add check

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:14, Matthew R. Ochs wrote: > 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. Additional

Re: [PATCH v6 17/37] cxlflash: Remove dual port online dependency

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:13, Matthew R. Ochs wrote: > At present, both ports must be online for the device to > configure properly. Remove this dependency and the unnecessary > internal LUN override logic as well. Additionally, as a refactoring > measure, change the return code variable name to match that

Re: [PATCH v6 16/37] cxlflash: Fix async interrupt bypass logic

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:13, Matthew R. Ochs wrote: > 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

Re: [PATCH v6 14/37] cxlflash: Fix location of setting resid

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:13, Matthew R. Ochs wrote: > 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 scen

Re: [PATCH v6 15/37] cxlflash: Fix host link up event handling

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:13, Matthew R. Ochs wrote: > 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 sh

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

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:13, Matthew R. Ochs wrote: > Borrowing the TMF waitq's spinlock causes a stall condition when > waiting for the TMF to complete. To remedy, introduce our own spin > lock to serialize TMF and use the appropriate wait services. > > Also add a timeout while waiting for a TMF completio

Re: [PATCH v6 12/37] cxlflash: Fix to avoid spamming the kernel log

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:13, Matthew R. Ochs wrote: > During run-time the driver can be very chatty and spam the system > kernel log. Various print statements can be limited and/or moved > to development-only mode. Additionally, numerous prints can be > converted to trace the corresponding device. Lastly,

Re: [PATCH v6 11/37] cxlflash: Refine host/device attributes

2015-10-23 Thread Tomas Henzl
On 21.10.2015 22:12, Matthew R. Ochs wrote: > 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

Re: [PATCH v3 05/15] scsi: ufs: increase fDeviceInit query response timeout

2015-10-23 Thread Akinobu Mita
2015-09-02 19:13 GMT+09:00 Yaniv Gardi : > fDeviceInit query response time for some devices is too long that default > query request timeout of 100ms may not be enough. Experiments show that > fDeviceInit response sometimes takes 500ms so to be on safer side this > change sets the timeout to 600ms.

Re: [PATCH] scsi_sysfs: protect against double execution of __scsi_remove_device()

2015-10-23 Thread Vitaly Kuznetsov
Bart Van Assche writes: > On 10/22/2015 10:12 AM, Vitaly Kuznetsov wrote: >> On some host errors storvsc module tries to remove sdev by scheduling a job >> which does the following: >> >> sdev = scsi_device_lookup(wrk->host, 0, 0, wrk->lun); >> if (sdev) { >> scsi_remove_device(sd