[PATCH v3 0/6] scsi_debug: bug fixes and cleanups for data integrity support

2013-05-26 Thread Akinobu Mita
This patch set includes bug fixes which I hit when I was tried testing the data integrity support in scsi_debug on x86_32. And it also includes cleanups which helps increasing readability and further bug fixing in data integrity support. * Changes from v2 - Add new bug fix patch for UNMAP

[PATCH v3 1/6] scsi_debug: fix invalid address passed to kunmap_atomic()

2013-05-26 Thread Akinobu Mita
In the function prot_verify_write(), the kmap address 'daddr' is incremented in the loop for each data page. Finally 'daddr' reaches the next page boundary in the end of the loop, and the invalid address is passed to kunmap_atomic(). Fix the issue by not incrementing 'daddr' in the loop and

[PATCH v3 2/6] scsi_debug: fix incorrectly nested kmap_atomic()

2013-05-26 Thread Akinobu Mita
In the function prot_verify_write(), kmap_atomic()/kunmap_atomic() for data page and kmap_atomic()/kunmap_atomic() for protection information page are not nested each other. It worked perfectly before commit 3e4d3af501cccdc8a8cca41bdbe57d54ad7e7e73 (mm: stack based kmap_atomic()). Because the

[PATCH v3 3/6] scsi_debug: fix NULL pointer dereference with parameters dif=0 dix=1

2013-05-26 Thread Akinobu Mita
The protection info dif_storep is allocated only when parameter dif is not zero. But it will be accessed when reading or writing to the storage installed with parameter dix is not zero. So kernel crashes if scsi_debug module is loaded with parameters dix=1 and dif=0. This fixes it by making

[PATCH v3 4/6] scsi_debug: invalidate protection info for unmapped region

2013-05-26 Thread Akinobu Mita
When UNMAP command is issued with the data integrity support enabled, the protection info for the unmapped region is remain unchanged. So READ command for the region later on causes data integrity failure. This fixes it by invalidating protection info for the unmapped region by filling with 0xff

[PATCH v3 5/6] scsi_debug: simplify offset calculation for dif_storep

2013-05-26 Thread Akinobu Mita
dif_storep is declared as pointer to unsigned char type. But it is actually used to store vmalloced array of struct sd_dif_tuple. This changes the type of dif_storep to the pointer to struct sd_dif_tuple. It simplifies offset calculation for dif_storep and enables to remove hardcoded size of

[PATCH v3 6/6] scsi_debug: reduce duplication between prot_verify_read and prot_verify_write

2013-05-26 Thread Akinobu Mita
In order to reduce code duplication between prot_verify_read() and prot_verify_write(), this moves common code into the new functions. Signed-off-by: Akinobu Mita akinobu.m...@gmail.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Douglas Gilbert dgilb...@interlog.com Cc: Martin K.

[PATCH] ufshcd-pltfrm: add missing empty slot in ufs_of_match[]

2013-05-26 Thread Akinobu Mita
of_match_table member in struct device_driver must be terminated by empty slot as a sentinel. Signed-off-by: Akinobu Mita m...@fixstars.com Cc: Vinayak Holikatti vinholika...@gmail.com Cc: Santosh Y santos...@gmail.com Cc: James E.J. Bottomley jbottom...@parallels.com Cc:

[PATCH 1/1] bfa: Fix for possible null pointer dereference

2013-05-26 Thread Jakob Normark
Fix for cppcheck error in bfa_fcs_lport.c Kernel version: v3.10-rc2 Signed-off-by: Jakob Normark jakobnorm...@gmail.com --- drivers/scsi/bfa/bfa_fcs_lport.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c

Re: SCSI error handling -- one error blocks the whole SCSI host

2013-05-26 Thread James Bottomley
On Thu, 2013-05-23 at 11:14 -0700, Roland Dreier wrote: At LSF this year, we had a discussion about error handling and in particular the problem that SCSI midlayer error handling waits for the entire SCSI host (HBA) to quiesce before it starts to abort commands etc. James made the

[PATCH 03/24] drivers/scsi/dmx3191d: Convert to module_pci_driver

2013-05-26 Thread Libo Chen
use module_pci_driver instead of init/exit, make code clean. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/scsi/dmx3191d.c | 13 + 1 files changed, 1 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/dmx3191d.c b/drivers/scsi/dmx3191d.c old mode 100644 new mode

[PATCH 04/24] drivers/scsi/initio: Convert to module_pci_driver

2013-05-26 Thread Libo Chen
use module_pci_driver instead of init/exit, make code clean. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/scsi/initio.c | 13 + 1 files changed, 1 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c old mode 100644 new mode 100755

[PATCH 05/24] drivers/scsi/mvumi: Convert to module_pci_driver

2013-05-26 Thread Libo Chen
use module_pci_driver instead of init/exit, make code clean. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/scsi/mvumi.c | 20 +--- 1 files changed, 1 insertions(+), 19 deletions(-) diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c old mode 100644 new mode

[PATCH 01/24] drivers/scsi/a100u2w: Convert to module_pci_driver

2013-05-26 Thread Libo Chen
use module_pci_driver instead of init/exit, make code clean. --- drivers/scsi/a100u2w.c | 12 +--- 1 files changed, 1 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c old mode 100644 new mode 100755 index 0163457..db3710f ---

[PATCH 02/24] drivers/scsi/dc395x: Convert to module_pci_driver

2013-05-26 Thread Libo Chen
use module_pci_driver instead of init/exit, make code clean. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/scsi/dc395x.c | 24 +--- 1 files changed, 1 insertions(+), 23 deletions(-) diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c old mode 100644 new

[PATCH RESEND 01/24] drivers/scsi/a100u2w: Convert to module_pci_driver

2013-05-26 Thread Libo Chen
use module_pci_driver instead of init/exit, make code clean. Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/scsi/a100u2w.c | 12 +--- 1 files changed, 1 insertions(+), 11 deletions(-) * add Signed-off-by: Libo Chen libo.c...@huawei.com diff --git a/drivers/scsi/a100u2w.c