[PATCH v2] scsi: sr: use block layer runtime PM

2013-09-05 Thread Aaron Lu
Migrate SCSI Optical Disk Drive(ODD) driver sr to make use of block layer runtime PM. Accordingly, the SCSI bus layer runtime PM callback is simplified as all SCSI devices that implement runtime PM are now request based. Note that due to ODD will be polled every 2 seconds, for suspend to actually

Re: [PATCH] scsi: sr: use block layer runtime PM

2013-09-05 Thread Aaron Lu
On 09/05/2013 10:25 PM, Alan Stern wrote: > On Thu, 5 Sep 2013, Aaron Lu wrote: > >> Migrate SCSI Optical Disk Drive(ODD) driver sr to make use of block >> layer runtime PM. Accordingly, the SCSI bus layer runtime PM callback is >> simplified as all SCSI devices that implement runtime PM are now r

[PATCH/RESEND 2/2] Hard disk S3 resume time optimization

2013-09-05 Thread Todd E Brandt
Part 2 of the hard disk resume optimization patch, this one applies to the scsi subsystem. Signed-off-by: Todd Brandt Signed-off-by: Arjan van de Ven drivers/scsi/sd.c | 82 - 1 file changed, 81 insertions(+), 1

[PATCH/RESEND 1/2] Hard disk S3 resume time optimization

2013-09-05 Thread Todd E Brandt
This is the final draft of the non-blocking hard disk resume patch. I've included some performance results to demonstrate the real benefits of this patch. Please note that this patch provides a MASSIVE performance improvement in hard disk resume. It's too valuable to ignore, so I really need the he

[PATCH 00/16] libfc, libfcoe, fcoe updates for 3.12(+)

2013-09-05 Thread Robert Love
The following series implements some fixes and enhancements. I know this series may be a bit late for the merge window. They have been in my tree so they could see some testing. Now that that is done I don't want to hold them back anymore. Please pull when appropriate. --- Bart Van Assche (13):

[PATCH 12/16] libfc: Do not invoke the response handler after fc_exch_done()

2013-09-05 Thread Robert Love
From: Bart Van Assche While the FCoE initiator driver invokes fc_exch_done() from inside the libfc response handler, FCoE target drivers typically invoke fc_exch_done() from outside the libfc response handler. The object fc_exch.arg points at may disappear as soon as fc_exch_done() has finished.

[PATCH 11/16] libfc: Reduce exchange lock contention in fc_exch_recv_abts()

2013-09-05 Thread Robert Love
From: Bart Van Assche Reduce the time during which the exchange lock is held by allocating a frame before obtaining the exchange lock. Signed-off-by: Bart Van Assche Cc: Neil Horman Signed-off-by: Robert Love --- drivers/scsi/libfc/fc_exch.c | 18 ++ 1 file changed, 10 inse

[PATCH 01/16] fcoe: ensure that skb placed on the fip_recv_list are unshared

2013-09-05 Thread Robert Love
From: Neil Horman Recently had this Oops reported to me on the 3.10 kernel: [ 807.554955] BUG: unable to handle kernel NULL pointer dereference at 0008 [ 807.562799] IP: [] skb_dequeue+0x47/0x70 [ 807.568296] PGD 20c889067 PUD 20c8b8067 PMD 0 [ 807.572769] Oops: 0002 [#1] SMP [

[PATCH 10/16] libfc: Avoid that sending after an abort triggers a kernel warning

2013-09-05 Thread Robert Love
From: Bart Van Assche Calling fc_seq_send() after an ABTS message has been received triggers a kernel warning (WARN_ON(!(ep->esb_stat & ESB_ST_SEQ_INIT))). Avoid this by returning -ENXIO to the caller if fc_seq_send() is invoked after an ABTS message has been received. Signed-off-by: Bart Van As

[PATCH 06/16] libfc: Micro-optimize fc_setup_exch_mgr()

2013-09-05 Thread Robert Love
From: Bart Van Assche Convert a loop into an ilog2() call. Although this code is not performance sensitive this conversion makes this code easier to read. Signed-off-by: Bart Van Assche Cc: Neil Horman Signed-off-by: Robert Love --- drivers/scsi/libfc/fc_exch.c | 10 +++--- 1 file chan

[PATCH 15/16] fcoe: Add missing newlines in debug messages

2013-09-05 Thread Robert Love
From: Bart Van Assche FCoE debug statements must end in a newline. Add one where it is missing. Signed-off-by: Bart Van Assche Cc: Neil Horman Signed-off-by: Robert Love --- drivers/scsi/fcoe/fcoe.c | 12 ++-- drivers/scsi/fcoe/fcoe_sysfs.c | 12 ++-- 2 files change

[PATCH 07/16] libfc: Clarify fc_exch_find()

2013-09-05 Thread Robert Love
From: Bart Van Assche The condition ep != NULL && ep->xid != xid can never be met. Make this explicit. Signed-off-by: Bart Van Assche Cc: Neil Horman Signed-off-by: Robert Love --- drivers/scsi/libfc/fc_exch.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/

[PATCH 14/16] fcoe: Declare fcoe_ctlr_mode_set() static

2013-09-05 Thread Robert Love
From: Bart Van Assche The function fcoe_ctlr_mode_set() is local, hence declare it static. Signed-off-by: Bart Van Assche Cc: Neil Horman Signed-off-by: Robert Love --- drivers/scsi/fcoe/fcoe_ctlr.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/fcoe/

[PATCH 04/16] libfc: Source code comment spelling fixes

2013-09-05 Thread Robert Love
From: Bart Van Assche Change 'initiaive' into 'initiative', 'remainig' into 'remaining' and change 'exected' into 'expected'. Signed-off-by: Bart Van Assche Signed-off-by: Robert Love --- drivers/scsi/libfc/fc_exch.c |5 + drivers/scsi/libfc/fc_lport.c |2 +- drivers/scsi/libfc/f

[PATCH 16/16] fcoe: Reduce fcoe_sysfs_fcf_add() stack usage

2013-09-05 Thread Robert Love
From: Bart Van Assche This patch fixes the following compiler warning: drivers/scsi/fcoe/fcoe_ctlr.c: In function fcoe_sysfs_fcf_add: drivers/scsi/fcoe/fcoe_ctlr.c:211:1: warning: the frame size of 1480 bytes is larger than 1024 bytes [-Wframe-larger-than=] Signed-off-by: Bart Van Assche Cc:

[PATCH 05/16] libfc: Debug code fixes

2013-09-05 Thread Robert Love
From: Bart Van Assche The second argument of fc_lport_error() may be a valid frame pointer. Hence only print it as an error code if it really is an error code. Debug statements must end in a newline. Add one where it is missing. Signed-off-by: Bart Van Assche Cc: Neil Horman Signed-off-by: Ro

[PATCH 13/16] fcp: Do not interpret check condition as underrun

2013-09-05 Thread Robert Love
From: Bart Van Assche This patch avoids that the FCoE initiator sends a REC message after having received a SCSI response with non-zero status and non-zero DATA IN buffer length. Signed-off-by: Bart Van Assche Cc: Neil Horman Signed-off-by: Robert Love --- drivers/scsi/libfc/fc_fcp.c | 10

[PATCH 09/16] libfc: Protect ep->esb_stat changes via ex_lock

2013-09-05 Thread Robert Love
From: Bart Van Assche This patch avoids that the WARN_ON(!(ep->esb_stat & ESB_ST_SEQ_INIT)) statement in fc_seq_send_locked() gets triggered sporadically when running FCoE target code due to concurrent ep->esb_stat modifications. Signed-off-by: Bart Van Assche Cc: Neil Horman Signed-off-by: Ro

[PATCH 02/16] fcoe: make sure fcoe frames are unshared prior to manipulating them

2013-09-05 Thread Robert Love
From: Neil Horman Based on my last patch I noticed that fcoe_rcv has a simmilar problem, in that it manipulates the passed in skb without checking to see if it has other users. Making manipulations to a shared skb can result in various corruptions. Easy fix, just make sure the skb is unshared pr

[PATCH 03/16] fcoe: cleanup return codes from fcoe_rcv

2013-09-05 Thread Robert Love
From: Neil Horman the return codes from fcoe_rcv should be NET_RX_*, not 0 or -1. Signed-off-by: Neil Horman Signed-off-by: Robert Love --- drivers/scsi/fcoe/fcoe.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c i

[PATCH 08/16] libfc: Fix a race in fc_exch_timer_set_locked()

2013-09-05 Thread Robert Love
From: Bart Van Assche It is allowed to pass a zero timeout value to fc_seq_exch_abort(). Avoid that this can cause the timeout function to drop the exchange reference before it has been increased by fc_exch_timer_set_locked(). This patch fixes a crash when running FCoE target code with poisoning

fcoe pull request for 3.12(+)

2013-09-05 Thread Love, Robert W
The following changes since commit 6e4664525b1db28f8c4e1130957f70a94c19213e: Linux 3.11 (2013-09-02 13:46:10 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/rwlove/fcoe.git tags/show for you to fetch changes up to 1c2c1b4fbd413fd814807768d2aba9

[PATCH V2 3/7] SCSI: esas2r: smatch - Fix dereference that occurs prior to check

2013-09-05 Thread Bradley Grove
Signed-off-by: Bradley Grove --- drivers/scsi/esas2r/esas2r_flash.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/esas2r/esas2r_flash.c b/drivers/scsi/esas2r/esas2r_flash.c index 8582929..45e353f 100644 --- a/drivers/scsi/esas2r/esas2r_flash.c +++ b/driv

[PATCH V2 4/7] SCSI: esas2r: smatch - Fix overrun due to sprintf appending NULL

2013-09-05 Thread Bradley Grove
Signed-off-by: Bradley Grove --- drivers/scsi/esas2r/esas2r_vda.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/esas2r/esas2r_vda.c b/drivers/scsi/esas2r/esas2r_vda.c index f8ec6d6..fd13928 100644 --- a/drivers/scsi/esas2r/esas2r_vda.c +++ b/drivers/scsi

[PATCH V2 5/7] SCSI: esas2r: smatch - Remove test for impossible condition (uint8 > 255)

2013-09-05 Thread Bradley Grove
Signed-off-by: Bradley Grove --- drivers/scsi/esas2r/esas2r_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/esas2r/esas2r_ioctl.c b/drivers/scsi/esas2r/esas2r_ioctl.c index f3d0cb8..e5b0902 100644 --- a/drivers/scsi/esas2r/esas2r_ioctl.c +++ b/drivers/sc

[PATCH V2 2/7] SCSI: esas2r: smatch - Fix dereference that occurs prior to check

2013-09-05 Thread Bradley Grove
Signed-off-by: Bradley Grove --- drivers/scsi/esas2r/esas2r_init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c index 78b18c1..9aaad0d 100644 --- a/drivers/scsi/esas2r/esas2r_init.c +++ b/drivers/scsi

[PATCH V2 0/7] SCSI: esas2r: Static check fixes

2013-09-05 Thread Bradley Grove
This series of patches fixes errors detected by smatch and coccinelle. V2 adds an additional fix, removing a null check on a stack allocated array. The test was needed in older versions of the driver when the buffer was allocated on the heap. Bradley Grove (7): SCSI: esas2r: smatch - Use bi

[PATCH V2 1/7] SCSI: esas2r: smatch - Use biwise rather than logical AND for checking if any bit set

2013-09-05 Thread Bradley Grove
Signed-off-by: Bradley Grove --- drivers/scsi/esas2r/esas2r_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c index 3a798e7..78b18c1 100644 --- a/drivers/scsi/esas2r/esas2r_init.c +++ b/drivers/scsi/e

[PATCH V2 6/7] SCSI: esas2r: coccinelle - Replace memcpy with struct assignment

2013-09-05 Thread Bradley Grove
Signed-off-by: Bradley Grove --- drivers/scsi/esas2r/esas2r_flash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/esas2r/esas2r_flash.c b/drivers/scsi/esas2r/esas2r_flash.c index 45e353f..2ec3c23 100644 --- a/drivers/scsi/esas2r/esas2r_flash.c +++ b/driver

[PATCH V2 7/7] SCSI: esas2r: Remove null test for stack allocated fw_coredump_buffer

2013-09-05 Thread Bradley Grove
Signed-off-by: Bradley Grove --- drivers/scsi/esas2r/esas2r_init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c index 9aaad0d..da1869d 100644 --- a/drivers/scsi/esas2r/esas2r_init.c +++ b/drivers/scsi

RE: [Qemu-devel] Testing NPIV Feature with Qemu-KVM

2013-09-05 Thread Love, Robert W
> > How do I make sure that qemu is using the virtual HBA or (vport)? > > From my limited knowledge of NPIV, after you create the vport on the host > you'll have a new "SCSI host" which scans LUNs. That means new SCSI > devices appear on the host. > > You can use "ls -al /sys/class/scsi_host"

Re: [Qemu-devel] Testing NPIV Feature with Qemu-KVM

2013-09-05 Thread Love, Robert W
On 13-09-05 07:15 AM, Stefan Hajnoczi wrote: > On Mon, Sep 2, 2013 at 2:34 PM, chandrashekar shastri > wrote: >> I am testing NPIV feature on upstream Qemu, I have configured the zone >> and able to see the created vport on the storage array. >> >> Since, I am learning on how to setup the NPIV, I

Re: [PATCH] scsi: sr: use block layer runtime PM

2013-09-05 Thread Alan Stern
On Thu, 5 Sep 2013, Aaron Lu wrote: > Migrate SCSI Optical Disk Drive(ODD) driver sr to make use of block > layer runtime PM. Accordingly, the SCSI bus layer runtime PM callback is > simplified as all SCSI devices that implement runtime PM are now request > based. > > Signed-off-by: Aaron Lu > -

Re: [Qemu-devel] Testing NPIV Feature with Qemu-KVM

2013-09-05 Thread Stefan Hajnoczi
On Mon, Sep 2, 2013 at 2:34 PM, chandrashekar shastri wrote: > I am testing NPIV feature on upstream Qemu, I have configured the zone > and able to see the created vport on the storage array. > > Since, I am learning on how to setup the NPIV, I haven't created the > different zone for > the vport

Re: fix swapped arguments in aic7xxx:ahc_find_pci_device

2013-09-05 Thread Hannes Reinecke
On 09/05/2013 04:33 AM, Dave Jones wrote: > The prototype for ahc_9005_subdevinfo_valid shows that the caller has the > arguments in the wrong order. > > 637 ahc_9005_subdevinfo_valid(uint16_t device, uint16_t vendor, > 638 uint16_t subdevice, uint16_t subvendor) > > S

Re: Potential out-of-bounds access in drivers/scsi/sd.c

2013-09-05 Thread Hannes Reinecke
On 09/04/2013 05:42 PM, Alan Stern wrote: > On Wed, 4 Sep 2013, Paolo Bonzini wrote: > >>> --- usb-3.11.orig/drivers/scsi/sd.c >>> +++ usb-3.11/drivers/scsi/sd.c >>> @@ -2419,7 +2419,7 @@ sd_read_cache_type(struct scsi_disk *sdk >>> } >>> } >>> >>> - if

RE: [PATCH] scsi: bfa: Use ARRAY_SIZE

2013-09-05 Thread Vijaya Mohan Guvva
> -Original Message- > From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi- > ow...@vger.kernel.org] On Behalf Of Christoph Jaeger > Sent: Sunday, September 01, 2013 1:05 AM > To: James E.J. Bottomley > Cc: linux-scsi@vger.kernel.org; Christoph Jaeger > Subject: [PATCH] scsi: bfa: Use

[PATCH] scsi: Add printk to detect retry loop

2013-09-05 Thread Eiichi Tsukata
Currently, scsi error handling in scsi_decide_disposition() unconditionally retries on some errors. This is because retriable errors are thought to be temporary and the scsi device will soon recover from those errors. But there is no guarantee that the device is able to recover from error state imm

[PATCH] scsi: Add printk to detect retry loop

2013-09-05 Thread Eiichi Tsukata
Hello, This patch is to avoid indefinite command retry loop. The previous RFC patch is here: http://marc.info/?t=13769053762&r=1&w=3 In the previous discuss, James says that once retry loop is detected, whether or not to panic(offline) should be decided by user, and not in scsi subsystem. So

[PATCH v2 6/6] scsi/qla2xxx: use pcie_is_pcie() to simplify code

2013-09-05 Thread Yijing Wang
Use pci_is_pcie() instead of pci_find_capability to simplify code. Acked-by: Chad Dupuis Signed-off-by: Yijing Wang Cc: Andrew Vasquez Cc: linux-dri...@qlogic.com Cc: "James E.J. Bottomley" Cc: linux-scsi@vger.kernel.org Cc: linux-ker...@vger.kernel.org --- drivers/scsi/qla2xxx/qla_mr.c |

[PATCH v2 2/6] scsi/csiostor: use pcie_capability_xxx to simplify code

2013-09-05 Thread Yijing Wang
v1->v2: add #define for Completion Timeout Value, and use pcie_capability_clear_and_set_word() instead suggested by Bjorn. Pcie_capability_xxx() interfaces were introduced to simplify code to access PCIe Cap config space. And because PCI core saves the PCIe Cap offset in set_pcie_port_type

[PATCH v2 1/6] scsi/bfa: use pcie_set/get_readrq to simplify code

2013-09-05 Thread Yijing Wang
v1->v2: use pcie_get/set_readrq to simplify code a lot suggestd by Bjorn. Use pcie_get_readrq()/pcie_set_readrq() to simplify code. Signed-off-by: Yijing Wang Cc: Jiang Liu Cc: Anil Gurumurthy Cc: Vijaya Mohan Guvva Cc: "James E.J. Bottomley" Cc: linux-scsi@vger.kernel.org Cc: linux-ker...@v

Re: [PATCH 2/7] scsi/csiostor: use pcie_capability_xxx to simplify code

2013-09-05 Thread Yijing Wang
On 2013/9/4 7:43, Bjorn Helgaas wrote: > On Tue, Sep 03, 2013 at 03:35:10PM +0800, Yijing Wang wrote: >> Pcie_capability_xxx() interfaces were introudced to > > s/introudced/introduced/ Will update it. > >> simplify code to access PCIe Cap config space. And >> because PCI core saves the PCIe Ca

Re: [PATCH 4/5] uas: add dead request list

2013-09-05 Thread Oliver Neukum
On Mon, 2013-09-02 at 13:25 +0200, Gerd Hoffmann wrote: > +static void uas_zap_dead(struct uas_dev_info *devinfo) > +{ > + struct uas_cmd_info *cmdinfo; > + struct uas_cmd_info *temp; > + struct list_head list; > + unsigned long flags; > + > + spin_lock_irq(&uas_lists_

Re: [PATCH 1/7] scsi/bfa: use pcie_capability_xxx to simplify code

2013-09-05 Thread Yijing Wang
>> @@ -794,10 +793,8 @@ bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad) >> break; >> } >> >> -pcie_cap_reg = pci_find_capability(pdev, PCI_CAP_ID_EXP); >> -if (mask != 0x && pcie_cap_reg) { >> -pcie_cap_reg