Re: [PATCH 0/8] qla4xxx: 5.04.00-k3: Updates for scsi "misc" branch

2013-12-16 Thread Mike Christie
On 11/22/13 4:28 AM, vikas.chaudh...@qlogic.com wrote: From: Vikas Chaudhary James, Please apply the following patches to the scsi tree at your earliest convenience. These patches are on top of other qla4xxx patch posted on list here: http://marc.info/?l=linux-scsi&m=138210321629250&w=2 Adh

Re: [PATCH 5/6] sd: don't start disks on system resume

2013-12-16 Thread James Bottomley
On Mon, 2013-12-16 at 18:30 -0500, Phillip Susi wrote: > Instead of forcing a disk to start up with the START STOP UNIT > command when the system resumes, let it stay asleep if runtime > pm is enabled, and it will start the drive when it is accessed. > Query the drive to see if it starts up on its

[PATCH V2] virtio-scsi: Fix hotcpu_notifier use-after-free with virtscsi_freeze

2013-12-16 Thread Jason Wang
From: Asias He vqs are freed in virtscsi_freeze but the hotcpu_notifier is not unregistered. We will have a use-after-free usage when the notifier callback is called after virtscsi_freeze. Fixes: 285e71ea6f3583a85e27cb2b9a7d8c35d4c0d558 ("virtio-scsi: reset virtqueue affinity when doing cpu hotp

Re: [PATCH] virtio-scsi: Fix hotcpu_notifier use-after-free with virtscsi_freeze

2013-12-16 Thread Jason Wang
On 12/17/2013 11:09 AM, Rusty Russell wrote: > Jason Wang writes: >> > On 10/28/2013 04:01 PM, Asias He wrote: >>> >> vqs are freed in virtscsi_freeze but the hotcpu_notifier is not >>> >> unregistered. We will have a use-after-free usage when the notifier >>> >> callback is called after virtscsi_

[PATCH V2 13/20] qla2xxx: Remove ISP_ABORT_NEEDED and ISP_ABORT_RETRY checks from watchdog function for ISP8044.

2013-12-16 Thread Saurav Kashyap
From: Atul Deshmukh Signed-off-by: Atul Deshmukh Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_nx2.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nx2.c b/drivers/scsi/qla2xxx/qla_nx2.c index eda7787..0350a59 100644 --- a/driver

[PATCH V2 12/20] qla2xxx: Remove Marker type IOCB logic for ISPFX00.

2013-12-16 Thread Saurav Kashyap
From: Armen Baloyan Signed-off-by: Armen Baloyan Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_iocb.c | 11 +-- drivers/scsi/qla2xxx/qla_mr.c | 12 drivers/scsi/qla2xxx/qla_mr.h | 24 3 files changed, 1 insertions(+), 46 dele

[PATCH V2 15/20] qla2xxx: Avoid poisoning in the response queue for ISPFX00.

2013-12-16 Thread Saurav Kashyap
Signed-off-by: Giridhar Malavali Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_mr.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c index 03e2050..290322f 100644 --- a/drivers/scsi/q

[PATCH V2 20/20] qla2xxx: Update the driver version to 8.07.00.02-k.

2013-12-16 Thread Saurav Kashyap
Signed-off-by: Saurav Kashyap Signed-off-by: Giridhar Malavali --- drivers/scsi/qla2xxx/qla_version.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 31d1953..e36b947 100644 --- a/drivers/s

[PATCH V2 10/20] scsi_transport_fc: Add 32Gbps speed definition.

2013-12-16 Thread Saurav Kashyap
From: Chad Dupuis Signed-off-by: Chad Dupuis Signed-off-by: Saurav Kashyap --- drivers/scsi/scsi_transport_fc.c |1 + include/scsi/scsi_transport_fc.h |1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.

[PATCH V2 16/20] qla2xxx: Simplify the ISPFX00 interrupt handler code for ISPFX00.

2013-12-16 Thread Saurav Kashyap
Signed-off-by: Giridhar Malavali Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_mr.c | 25 + drivers/scsi/qla2xxx/qla_mr.h |4 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_m

[PATCH V2 05/20] qla2xxx: Remove init control block related dead code for ISPFX00.

2013-12-16 Thread Saurav Kashyap
Signed-off-by: Giridhar Malavali Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_def.h | 24 drivers/scsi/qla2xxx/qla_mr.c | 14 -- drivers/scsi/qla2xxx/qla_os.c |1 - 3 files changed, 0 insertions(+), 39 deletions(-) diff --git a/driver

[PATCH V2 18/20] qla2xxx: Correctly set the read_optrom pointer for ISP8044.

2013-12-16 Thread Saurav Kashyap
Signed-off-by: Giridhar Malavali Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_os.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 3f69e7c..24af8e0 100644 --- a/drivers/scsi/qla2xxx/qla_os

[PATCH V2 00/20] qla2xxx: Patches for 3.13 scsi "misc" branch.

2013-12-16 Thread Saurav Kashyap
Hi James, Please apply the following patches to the scsi tree, misc branch at your earliest convenience. Thanks, ~Saurav Armen Baloyan (4): qla2xxx: Add handling for boot indication progress AENs for ISPFX00. qla2xxx: Replace constant value for IOCTL IOCB abort execution status with a m

[PATCH V2 02/20] qla2xxx: Add handling for boot indication progress AENs for ISPFX00.

2013-12-16 Thread Saurav Kashyap
From: Armen Baloyan Signed-off-by: Armen Baloyan Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_def.h |2 +- drivers/scsi/qla2xxx/qla_mr.c |3 +++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h

[PATCH V2 08/20] qla2xxx: Properly handle 32 bit mailbox register for ISPFX00.

2013-12-16 Thread Saurav Kashyap
Signed-off-by: Saurav Kashyap Signed-off-by: Giridhar Malavali --- drivers/scsi/qla2xxx/qla_mr.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c index 9839da8..ed44ec6 100644 --- a/drivers/scsi/qla2

[PATCH V2 09/20] qla2xxx: Set host can_queue value based on available resources.

2013-12-16 Thread Saurav Kashyap
From: Chad Dupuis Tell the mid-layer that number of commands we can queue is the available resources we have minus a small amount for internal commands. Signed-off-by: Chad Dupuis Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_os.c | 20 +++- 1 files changed, 11

[PATCH V2 17/20] qla2xxx: Read capture firmware dump on mailbox timeout for ISP8044 and ISP82XX.

2013-12-16 Thread Saurav Kashyap
From: Chad Dupuis Allow for the capture of a firmware dump but have a sysfs node (allow_cna_fw_dump) to allow the feature to be enabled/disabled dynamically. The default is off. Signed-off-by: Chad Dupuis Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_attr.c | 35 ++

[PATCH V2 07/20] qla2xxx: Enable the Flash Access Control (FAC) mailbox command.

2013-12-16 Thread Saurav Kashyap
From: Joe Carnuccio Signed-off-by: Joe Carnuccio Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_init.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index e7e5f4f..9b271cc 100644 --- a/

[PATCH V2 19/20] qla2xxx: Fix multiqueue MSI-X registration.

2013-12-16 Thread Saurav Kashyap
From: Chad Dupuis This fixes requesting of the MSI-X vectors for the base response queue. The iteration in the for loop in qla24xx_enable_msix() was incorrect. We should only iterate of the first two MSI-X vectors and not the total number of MSI-X vectors that have given to the driver for this de

[PATCH V2 06/20] qla2xxx: Select correct request queue for error type IOCB for ISPFX00.

2013-12-16 Thread Saurav Kashyap
Signed-off-by: Giridhar Malavali Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_mr.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c index 4542247..9839da8 100644 --- a/drivers/scsi/qla2xxx/qla_mr

[PATCH V2 04/20] qla2xxx: Use proper message for Non owner reset ACK Timeout.

2013-12-16 Thread Saurav Kashyap
From: Atul Deshmukh Signed-off-by: Atul Deshmukh Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_nx2.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nx2.c b/drivers/scsi/qla2xxx/qla_nx2.c index b45f4d7..eda7787 100644 --- a/driv

[PATCH V2 01/20] qla2xxx: Add mutex around optrom calls to serialize accesses.

2013-12-16 Thread Saurav Kashyap
From: Chad Dupuis Signed-off-by: Chad Dupuis Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_attr.c | 61 ++ drivers/scsi/qla2xxx/qla_bsg.c | 12 ++- drivers/scsi/qla2xxx/qla_def.h |1 + drivers/scsi/qla2xxx/qla_os.c |1 + 4 fi

[PATCH V2 14/20] qla2xxx: Add changes in the IOCB structures to adjust driver source codes to ISPFX00 firmware spec.

2013-12-16 Thread Saurav Kashyap
From: Armen Baloyan Signed-off-by: Armen Baloyan Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_mr.c | 10 +- drivers/scsi/qla2xxx/qla_mr.h | 26 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/

[PATCH V2 03/20] qla2xxx: Replace constant value for IOCTL IOCB abort execution status with a macro for ISPFX00.

2013-12-16 Thread Saurav Kashyap
From: Armen Baloyan Signed-off-by: Armen Baloyan Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_mr.c |3 ++- drivers/scsi/qla2xxx/qla_mr.h |3 +++ 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c in

Re: [PATCH 16/20] qla2xxx: Simplyfy the ISPFX00 interrupt handler code for ISPFX00.

2013-12-16 Thread Saurav Kashyap
Hi Bart, Thanks for the feedback, I will be submitting the updated patches soon. Thanks, ~Saurav >On 12/13/13 21:03, Saurav Kashyap wrote: >> [ ... ] > >Shouldn't the subject of this patch read "Simplify" instead of "Simplyfy" >? > >Bart. > <>

Re: [PATCH] virtio-scsi: Fix hotcpu_notifier use-after-free with virtscsi_freeze

2013-12-16 Thread Rusty Russell
Jason Wang writes: > On 10/28/2013 04:01 PM, Asias He wrote: >> vqs are freed in virtscsi_freeze but the hotcpu_notifier is not >> unregistered. We will have a use-after-free usage when the notifier >> callback is called after virtscsi_freeze. >> >> Signed-off-by: Asias He Please include a Fixes

Re: [PATCH 0/32] Refcounts and rbtrees to increase luns above 255

2013-12-16 Thread Nicholas A. Bellinger
On Mon, 2013-12-16 at 18:03 -0800, Andy Grover wrote: > On 12/16/2013 05:59 PM, Nicholas A. Bellinger wrote: > > > I do appreciate the effort, but the extra pointer chasing here makes > > rbtrees prohibitively expensive for fast past operations. > > Hmm, were they actually implemented and tried a

Re: [PATCH 0/32] Refcounts and rbtrees to increase luns above 255

2013-12-16 Thread Andy Grover
On 12/16/2013 05:59 PM, Nicholas A. Bellinger wrote: I do appreciate the effort, but the extra pointer chasing here makes rbtrees prohibitively expensive for fast past operations. Hmm, were they actually implemented and tried at some point? -- To unsubscribe from this list: send the line "uns

Re: [PATCH 0/32] Refcounts and rbtrees to increase luns above 255

2013-12-16 Thread Nicholas A. Bellinger
On Mon, 2013-12-16 at 17:49 -0800, Andy Grover wrote: > On 12/16/2013 02:03 PM, Nicholas A. Bellinger wrote: > > On Fri, 2013-12-13 at 15:58 -0800, Andy Grover wrote: > >> Hi Nicholas, > >> > >> This patchset uses krefs to refcount structures shared across threads. > >> LIO is full of these because

Re: [PATCH 19/32] target: Convert to rbtree for se_dev_entry in se_node_acl

2013-12-16 Thread Nicholas A. Bellinger
On Mon, 2013-12-16 at 17:00 -0800, Andy Grover wrote: > On 12/16/2013 01:40 PM, Nicholas A. Bellinger wrote: > > On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > >> Instead of an array, use a rbtree. Less memory use on average, and > >> can allow >255 entries. We go from O(1) to O(log n) on

Re: [PATCH 0/32] Refcounts and rbtrees to increase luns above 255

2013-12-16 Thread Andy Grover
On 12/16/2013 02:03 PM, Nicholas A. Bellinger wrote: On Fri, 2013-12-13 at 15:58 -0800, Andy Grover wrote: Hi Nicholas, This patchset uses krefs to refcount structures shared across threads. LIO is full of these because configfs-based configuration actions can be removing an object, even while

Re: [PATCH 19/32] target: Convert to rbtree for se_dev_entry in se_node_acl

2013-12-16 Thread Andy Grover
On 12/16/2013 01:40 PM, Nicholas A. Bellinger wrote: On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: Instead of an array, use a rbtree. Less memory use on average, and can allow >255 entries. We go from O(1) to O(log n) on lookups. If this shows up on profiling (it won't) then transition t

[PATCH 2/6] libata: avoid waking disk for several commands

2013-12-16 Thread Phillip Susi
When a disk is in SLEEP mode it can not respond to any commands. Instead of waking up the sleeping disk, fake the commands. The commands include: CHECK POWER FLUSH CACHE SLEEP STANDBY IMMEDIATE IDENTIFY If we konw the disk is sleeping, we don't need to wake it up to to find out if it is in stan

[PATCH 5/6] sd: don't start disks on system resume

2013-12-16 Thread Phillip Susi
Instead of forcing a disk to start up with the START STOP UNIT command when the system resumes, let it stay asleep if runtime pm is enabled, and it will start the drive when it is accessed. Query the drive to see if it starts up on its own ( like most ATA disks do ) and update the runtime pm status

[PATCH 4/6] libata: don't start disks on resume

2013-12-16 Thread Phillip Susi
Disks with Power Up In Standby enabled that required the SET FEATURES command to start up were being issued the command during resume. Suppress this until the disk is actually accessed. --- drivers/ata/libata-core.c | 12 ++-- drivers/ata/libata-eh.c | 10 -- drivers/ata/libata.

[PATCH 1/6] libata: use sleep instead of standby command

2013-12-16 Thread Phillip Susi
The ATA SLEEP mode saves some more power than SUSPEND, and has basically the same recovery time, so use it instead. --- drivers/ata/libata-scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index db6dfcf..f92eb21 100

[PATCH 3/6] libata: resume in the background

2013-12-16 Thread Phillip Susi
Don't block the resume path waiting for the disk to spin up. --- drivers/ata/libata-core.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 8f856bb..4a28caf 100644 --- a/drivers/ata/libata-core.c +++ b/driver

[PATCH 6/6] libata: return power status in REQUEST SENSE command

2013-12-16 Thread Phillip Susi
SAT-3 says REQUEST SENSE should issue CHECK POWER and return a sense status indicating the drive's power status. --- drivers/ata/libata-scsi.c | 40 ++-- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libat

[PATCH 0/6] Let sleeping disks lie

2013-12-16 Thread Phillip Susi
This is the set I currently have. I fixed libata to implement the REQUEST SENSE scsi command, and set up sd to use blk_pre_runtime_suspend to force the queue to the RPM_SUSPENDING state while issuing the REQUEST SENSE command to make sure other requests are blocked, then if REQUEST SENSE indicates

Re: [PATCH 32/32] target: Increase MAX_LUNS_PER_TPG to 16384

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > Indicate support for hierarchical LUN addressing. > > Set address method field in each LUN reported by REPORT LUNS to 1, in > accordance with SCSI SAM specs. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_spc.c |8 +

Re: [PATCH 0/32] Refcounts and rbtrees to increase luns above 255

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:58 -0800, Andy Grover wrote: > Hi Nicholas, > > This patchset uses krefs to refcount structures shared across threads. > LIO is full of these because configfs-based configuration actions can > be removing an object, even while that object is being used by a SCSI > command.

Re: [PATCH 30/32] target: Change nacl's session refcount to use existing refcount

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > core_tpg_del_initiator_node_acl is now safe to call with spinlocks, since > it no longer potentially sleeps. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_tpg.c | 10 -- > drivers/target/target_core_trans

Re: [PATCH 31/32] target: Don't release and re-acquire some spinlocks in loops

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > Here are some instances where we're looping, but then dropping the > spinlock around the loop in the loop, because we need to be able to > sleep in the calls. Since everything is refcounted now, this should no > longer be needed and we can jus

Re: [PATCH 29/32] target: Simplify params to core_tpg_del_initiator_node_acl

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > 'force' parameter is not used. > > tpg parameter is not needed, since we have acl->se_tpg. > > Signed-off-by: Andy Grover > --- > Documentation/target/tcm_mod_builder.py |2 +- > drivers/infiniband/ulp/srpt/ib_srpt.c|2

Re: [PATCH 28/32] target: Convert acl_pr_ref_count to kref

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > In fabrics' drop_nodeacl function, do not kfree the nacl. We are > now calling fabrics' tpg_release_fabric_acl later when its refcount > goes to zero, which will kfree it. > > Signed-off-by: Andy Grover > --- > Documentation/target/tcm_mod_

Re: [PATCH 27/32] target: Move call to remove_lun to the release function from drop_link

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > Configfs is still using the memory until release() is called, so it's not > safe to free it in drop_link(). > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_fabric_configfs.c | 10 +- > 1 files changed, 9 insertio

Re: [PATCH 26/32] target: Convert tpg_pr_ref_count to kref

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > Don't call fabric_drop_tpg from configfs release(), just lower the > refcount, and call fabric_drop_tpg when refcount goes to zero. > > We don't need cpu_relax because core_tpg_deregister will only be called > after we know there is no PR use

Re: [PATCH 24/32] target: Remove tpg from core_dev_export/unexport params

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > lun->lun_tpg should always be set. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_device.c | 17 +++-- > drivers/target/target_core_internal.h |6 ++ > drivers/target/target_core_tpg.c |4

Re: [PATCH 23/32] target: Add lun->lun_tpg pointer

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > Although the port also has a tpg pointer, if there's no port to link > (lun->lun_sep is NULL) then we can't get to it. So we need one in se_lun. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_tpg.c |2 ++ > include/t

Re: [PATCH 25/32] target: Call remove_lun instead of del_lun in fabric_port_unlink

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > We want to be freeing the port here, not freeing the lun. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_fabric_configfs.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > Skipping this one as well. --na

Re: [PATCH 21/32] target: Remove lun_link and device magic

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > Not needed. > Big NAK on this one. It most certainly is still required in order to prevent any random pointer from being passed into a configfs symlink sink for Port/LUN and MappedLUN creation. --nab > Signed-off-by: Andy Grover > --- >

Re: [PATCH 20/32] target: Convert to rbtree for se_lun list in se_portal_group

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > As with previous commit, this results in less average memory use, and > allows lun count to no longer be restrained by the array size. > NAK for the same reasons as the previous patch. rbtree introduces many extra memory addresses for point

Re: [PATCH 22/32] target: Convert percpu_ref to kref

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > Wasn't getting release called when I expected, so punted and went down > to krefs. Much simpler. > This is not an acceptable reason. NAK. --nab > Signed-off-by: Andy Grover > --- > drivers/target/target_core_device.c|5 ++--- >

Re: [PATCH 19/32] target: Convert to rbtree for se_dev_entry in se_node_acl

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > Instead of an array, use a rbtree. Less memory use on average, and > can allow >255 entries. We go from O(1) to O(log n) on lookups. If this > shows up on profiling (it won't) then transition to other kernel lookup > methods is straightforward

Re: [PATCH 18/32] target: More core_dev_del cleanups

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > core_dev_del_lun needs no return value. Also change it to take a se_lun* > instead of the unpacked lun. > > Rename core_tpg_pre_dellun to core_tpg_free_lun, and post_dellun to > remove_lun. Swap the order they are called, and hold off on sett

Re: [PATCH 17/32] target: Don't use void* when passing dev in core_tpg_add_lun

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > Especially since it's actually a device. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_internal.h |2 +- > drivers/target/target_core_tpg.c |4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > App

Re: [PATCH 16/32] target: Rename core_tpg_{pre,post}_addlun for clarity

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > "pre" is really an allocation function. The only time it isn't called is > for virtual_lun0, which is statically allocated. Renaming that to "alloc" > lets the other function not need to be "post", and just be called > core_tpg_add_lun. > > S

Re: [PATCH 14/32] target: Remove extra percpu_ref_init

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > lun->lun_ref is also initialized in core_tpg_post_addlun, so it doesn't > need to be done in core_tpg_setup_virtual_lun0. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_tpg.c |4 > 1 files changed, 0 insertions(+

Re: [PATCH 15/32] target: Refer to u32 luns as unpacked_lun

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > It's clearer to refer to pointers to the struct se_lun as "lun" and the > actual number itself as "unpacked_lun". > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_device.c | 16 > 1 files changed, 8 inser

Re: [PATCH 12/32] target: Convert t10_pr_registration to kref

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > Free struct when kref becomes 0. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_pr.c | 99 +++- > include/target/target_core_base.h |2 +- > 2 files changed, 42 insertions(+), 59 de

Re: [PATCH 13/32] target: Move spinlock inside core_release_port

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:59 -0800, Andy Grover wrote: > Keep locks closer to things they need to lock. > > sparse annotation no longer needed. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_device.c | 10 +++--- > 1 files changed, 3 insertions(+), 7 deletions(-) > I'l

Re: [PATCH 11/32] target: Convert se_dev_entry to kref

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:58 -0800, Andy Grover wrote: > Signed-off-by: Andy Grover > --- > drivers/target/target_core_device.c | 12 +++--- > drivers/target/target_core_internal.h | 12 ++ > drivers/target/target_core_pr.c | 38 > drivers

Re: [PATCH 10/32] target: Change sep_tg_pt_ref_cnt to use kref

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:58 -0800, Andy Grover wrote: > Use the kernel's std kref for refcounting. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_device.c | 12 ++-- > drivers/target/target_core_internal.h | 10 ++ > drivers/target/target_core_pr.c

Re: [PATCH 09/32] target: convert tg_pt_gp_mem_ref_cnt to kref

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:58 -0800, Andy Grover wrote: > Use kref to handle reference counting. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_alua.c | 23 ++- > include/target/target_core_base.h |2 +- > 2 files changed, 15 insertions(+), 10 deletions

Re: [PATCH 08/32] target: Convert tg_pt_gp_ref_cnt to kref

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:58 -0800, Andy Grover wrote: > Use kref to handle reference counting. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_alua.c | 39 +--- > include/target/target_core_base.h |2 +- > 2 files changed, 19 insertions(+),

Re: [PATCH 07/32] target: Convert struct alua_lu_gp_member to kref

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:58 -0800, Andy Grover wrote: > Signed-off-by: Andy Grover > --- > drivers/target/target_core_alua.c | 24 +++- > include/target/target_core_base.h |2 +- > 2 files changed, 16 insertions(+), 10 deletions(-) > > diff --git a/drivers/target/target

Re: [PATCH 06/32] target: Convert lu_gp_ref_cnt to kref

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:58 -0800, Andy Grover wrote: > Use kref to handle reference counting > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_alua.c | 37 > - > include/target/target_core_base.h |2 +- > 2 files changed, 21 insertions(

Re: [PATCH 05/32] target: Rename some list heads used as nodes

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:58 -0800, Andy Grover wrote: > Since everything's a list_head, naming it _node makes it clearer it's > to put the struct on a list, not a list head itself. > > Rename ua_nacl_list to ua_nacl_node > Rename alua_port_list to alua_port_node > Rename lu_gp_mem_list to lu_gp_me

Re: [PATCH 04/32] target: Fix sizeof in kmalloc for some default_groups arrays

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:58 -0800, Andy Grover wrote: > Allocating an array of pointers, not the objects themselves. These two > sites now match all the other sites. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_configfs.c|2 +- > drivers/target/target_core_fabric

Re: [PATCH 03/32] target: Allocate more room for port default groups

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:58 -0800, Andy Grover wrote: > See target_stat_setup_port_default_groups, we need a 4 element array. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_fabric_configfs.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/driver

Re: [PATCH 02/32] target: Don't keep looping in report_luns if too big

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:58 -0800, Andy Grover wrote: > All further loops will still fail the conditional so just bail right > away. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_spc.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/tar

Re: [PATCH 01/32] target: Remove unused ua_dev_list member in struct se_ua

2013-12-16 Thread Nicholas A. Bellinger
On Fri, 2013-12-13 at 15:58 -0800, Andy Grover wrote: > Initialized but not used. > > Signed-off-by: Andy Grover > --- > drivers/target/target_core_ua.c |1 - > include/target/target_core_base.h |1 - > 2 files changed, 0 insertions(+), 2 deletions(-) > Applied to for-next. --nab -

Re: [PATCH] iscsi_target: race condition on shutdown

2013-12-16 Thread Nicholas A. Bellinger
Hey Hannes, On Thu, 2013-12-12 at 09:05 +0100, Hannes Reinecke wrote: > On 12/12/2013 08:54 AM, Nicholas A. Bellinger wrote: > > On Thu, 2013-12-12 at 08:18 +0100, Hannes Reinecke wrote: > [ .. ] > > Mmmm, point taken.. > > > >> I would love to be proven wrong, as I'm not keen on the 'schedule

RE: [PATCH 3/3] st.ko: change enlarge_buffer result

2013-12-16 Thread Strösser , Bodo
> -Original Message- > From: "Kai Mäkisara (Kolumbus)" [mailto:kai.makis...@kolumbus.fi] > Sent: Monday, December 16, 2013 7:49 PM > To: Strösser, Bodo > Cc: linux-scsi@vger.kernel.org > Subject: Re: [PATCH 3/3] st.ko: change enlarge_buffer result > > > On 2.12.2013, at 21.00, Bodo Stro

RE: [PATCH 2/3] st.ko: remove unnecessary normalize_buffer

2013-12-16 Thread Strösser , Bodo
> -Original Message- > From: "Kai Mäkisara (Kolumbus)" [mailto:kai.makis...@kolumbus.fi] > Sent: Monday, December 16, 2013 7:45 PM > To: Strösser, Bodo > Cc: linux-scsi@vger.kernel.org > Subject: Re: [PATCH 2/3] st.ko: remove unnecessary normalize_buffer > > > On 2.12.2013, at 21.00, Bodo

Re: [PATCH 3/3] st.ko: change enlarge_buffer result

2013-12-16 Thread Kai Mäkisara (Kolumbus)
On 2.12.2013, at 21.00, Bodo Stroesser wrote: > From: Bodo Stroesser > Date: Mon, 2 Dec 2013 18:52:10 +0100 > Subject: [PATCH 3/3] st.ko: change enlarge_buffer result > > enlarge_buffer() just returns 1 or 0 if it could or could > not allocate the requested buffer. > > In case of result 0, th

Re: [PATCH 2/3] st.ko: remove unnecessary normalize_buffer

2013-12-16 Thread Kai Mäkisara (Kolumbus)
On 2.12.2013, at 21.00, Bodo Stroesser wrote: > From: Bodo Stroesser > Date: Mon, 2 Dec 2013 18:52:10 +0100 > Subject: [PATCH 2/3] st.ko: remove unnecessary normalize_buffer > > This patch removes an unnecessary call to normalize_buffer() > in enlarge_buffer() > > In st_open() always a buffer

Re: [PATCH 1/3] st.ko: fix enlarge_buffer

2013-12-16 Thread Kai Mäkisara (Kolumbus)
On 2.12.2013, at 21.00, Bodo Stroesser wrote: > From: Bodo Stroesser > Date: Mon, 2 Dec 2013 18:52:10 +0100 > Subject: [PATCH 1/3] st.ko: fix enlarge_buffer > > This patch removes a bug in enlarge_buffer() that can make a > read or write fail under special conditions. > > After changing TRY_D

Re: [RFC 1/2] fix our current target reap infrastructure.

2013-12-16 Thread Alan Stern
On Mon, 16 Dec 2013, James Bottomley wrote: > This patch eliminates the reap_ref and replaces it with a proper kref. > On last put of this kref, the target is removed from visibility in > sysfs. The final call to scsi_target_reap() for the device is done from > __scsi_remove_device() and only if

[RFC 2/2] dual scan thread bug fix

2013-12-16 Thread James Bottomley
In the highly unusual case where two threads are running concurrently through the scanning code scanning the same target, we run into the situation where one may allocate the target while the other is still using it. In this case, because the reap checks for STARGET_CREATED and kills the target wi

[RFC 1/2] fix our current target reap infrastructure.

2013-12-16 Thread James Bottomley
This patch eliminates the reap_ref and replaces it with a proper kref. On last put of this kref, the target is removed from visibility in sysfs. The final call to scsi_target_reap() for the device is done from __scsi_remove_device() and only if the device was made visible. This ensures that the t

[RFC 0/2] target refcounting infrastructure fixes for usb

2013-12-16 Thread James Bottomley
This set should fix our target problems with USB by making the target visibility properly reference counted. Since it's a major change to the infrastructure, we'll incubate upstream first before backporting to stable. James --- James Bottomley (2): [SCSI] fix our current target reap infrastru

Re: [PATCH] firewire: sbp2: allow WRITE SAME and REPORT SUPPORTED OPERATION CODES

2013-12-16 Thread Douglas Gilbert
On 13-12-15 09:52 AM, Stefan Richter wrote: On Dec 02 2012 Stefan Richter wrote: On Nov 26 Martin K. Petersen wrote: "Stefan" == Stefan Richter writes: Stefan> I did not try "sg_write_same" on any of the devices; but since Stefan> the two SPC-3 devices are correctly identified as "fully Stefa

[PATCH 19/24] qla4xxx: Update print statements in qla4xxx_mailbox_command()

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary Signed-off-by: Vikas Chaudhary --- drivers/scsi/qla4xxx/ql4_mbx.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c index 782a94586..1345c0e 100644 --- a/drivers/scsi/qla4xxx

[PATCH 10/24] qla4xxx: Clear DDB index map upon connection close failure

2013-12-16 Thread vikas.chaudhary
From: Nilesh Javali Issue: qla4xxx Unable to clear DDB indices when logout fails due to failure of connection close mbox command. Root cause: If login to session fail, iscsiadm make call to destroy_session. qla4xxx driver does not free ddb index map before free_ddb() Fix: Clear DDB Index map be

[PATCH 20/24] qla4xxx: Update print statements in func qla4xxx_eh_abort()

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary Signed-off-by: Vikas Chaudhary --- drivers/scsi/qla4xxx/ql4_os.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index d0a8695..410fe02 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b

[PATCH 12/24] qla4xxx: Fix processing response queue during probe

2013-12-16 Thread vikas.chaudhary
From: Tej Parkash Issue: While booting with kdump kernel, driver receive IOCB interrupts for which it is not ready which results in processing them before init_firmware during driver probe Fix: Two steps solution 1. Make driver ready to process the interrupt before interupts handlers is regis

[PATCH 21/24] qla4xxx: Update print statements in func qla4xxx_do_dpc()

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary Signed-off-by: Vikas Chaudhary --- drivers/scsi/qla4xxx/ql4_os.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 410fe02..e8a8a7d 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/

[PATCH 06/24] qla4xxx: Rename ACB_STATE macros with IP_ADDRSTATE macros

2013-12-16 Thread vikas.chaudhary
From: Nilesh Javali Signed-off-by: Nilesh Javali Signed-off-by: Vikas Chaudhary --- drivers/scsi/qla4xxx/ql4_fw.h | 24 drivers/scsi/qla4xxx/ql4_isr.c | 14 +++--- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b

[PATCH 0/24] qla4xxx: 5.04.00-k4: Updates for scsi "misc" branch

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary James, Please apply the following patches to the scsi tree at your earliest convenience. These patches are on top of other qla4xxx patch posted on list here: http://marc.info/?l=linux-scsi&m=138511809612830&w=2 Nilesh Javali (5): qla4xxx: ISP8xxx: Correct retry of a

[PATCH 02/24] qla4xxx: Print WARN_ONCE() if iSCSI function presence bit removed

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary Signed-off-by: Vikas Chaudhary --- drivers/scsi/qla4xxx/ql4_83xx.c | 20 drivers/scsi/qla4xxx/ql4_glbl.h | 1 + drivers/scsi/qla4xxx/ql4_os.c | 5 + 3 files changed, 26 insertions(+) diff --git a/drivers/scsi/qla4xxx/ql4_83xx.c b/drivers/scsi/

[PATCH 17/24] qla4xxx: Remove unused code from qla4xxx_set_ifcb()

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary Removing unused code as FW does not need any value in mbox-5. Signed-off-by: Vikas Chaudhary --- drivers/scsi/qla4xxx/ql4_mbx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c index cc27d7f..782a94586 1006

[PATCH 05/24] qla4xxx: Improve loopback failure messages

2013-12-16 Thread vikas.chaudhary
From: Nilesh Javali Signed-off-by: Vikas Chaudhary --- drivers/scsi/qla4xxx/ql4_bsg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_bsg.c b/drivers/scsi/qla4xxx/ql4_bsg.c index 04a0027..9f92cbf 100644 --- a/drivers/scsi/qla4xxx/ql4_bsg.c +++ b/

[PATCH 09/24] qla4xxx: Return correct error status from func qla4xxx_request_irqs()

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary Signed-off-by: Vikas Chaudhary --- drivers/scsi/qla4xxx/ql4_isr.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c index e56c6b4..49032f6 100644 --- a/drivers/scsi/qla4xxx/ql4_isr.c ++

[PATCH 01/24] qla4xxx: ISP8xxx: Correct retry of adapter initialization

2013-12-16 Thread vikas.chaudhary
From: Nilesh Javali Issue: For ISP8xxx, adapter initialization is not retried if qla4xxx_initialize_adapter fails. Fix: If qla4xxx_initialize_adapter fails, first check if failure is due to IRQs not attached in order to skip retrial, then free the IRQs and then retry initializing the adapter.

[PATCH 24/24] qla4xxx: Update driver version to 5.04.00-k4

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary Signed-off-by: Vikas Chaudhary --- drivers/scsi/qla4xxx/ql4_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla4xxx/ql4_version.h b/drivers/scsi/qla4xxx/ql4_version.h index 9b29466..c6ba0a6 100644 --- a/drivers/scsi/qla4xxx/ql4_v

[PATCH 18/24] qla4xxx: Updated print for device login, logout path

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary Signed-off-by: Vikas Chaudhary --- drivers/scsi/qla4xxx/ql4_os.c | 59 +++ 1 file changed, 43 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index ce20c75..d0a8695 100644 --

[PATCH 16/24] qla4xxx: Fix failure of mbox 0x31

2013-12-16 Thread vikas.chaudhary
From: Vikas Chaudhary Issue: While unloading driver MBOX 0x31 fail as DDB logout (MBOX 0x56) operation is not completed. Fix: Wait for DDB Logout completion before MBOX 0x31 Signed-off-by: Vikas Chaudhary --- drivers/scsi/qla4xxx/ql4_os.c | 54 --- 1 fi

[PATCH 08/24] qla4xxx: Fixed AER reset sequence for ISP83xx/ISP84xx

2013-12-16 Thread vikas.chaudhary
From: Tej Parkash Signed-off-by: Vikas Chaudhary --- drivers/scsi/qla4xxx/ql4_def.h | 3 ++- drivers/scsi/qla4xxx/ql4_os.c | 46 +- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_def.h b/drivers/scsi/qla4xxx/ql

[PATCH 22/24] qla4xxx: Handle IPv6 AEN notifications

2013-12-16 Thread vikas.chaudhary
From: Nilesh Javali Signed-off-by: Nilesh Javali Signed-off-by: Vikas Chaudhary --- drivers/scsi/qla4xxx/ql4_fw.h | 6 +++--- drivers/scsi/qla4xxx/ql4_isr.c | 30 ++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_fw.h b/dr

  1   2   >