Re: [PATCH V2 3/4] [SCSI] ufs: Add Platform glue driver for ufshcd

2012-07-16 Thread Namjae Jeon
Hi Vinayak. > + * ufshcd_pltfrm_remove - remove platform driver routine > + * @pdev: pointer to platform device handle > + * > + * Returns 0 on success, non-zero value on failure > + */ > +static int __devexit ufshcd_pltfrm_remove(struct platform_device *pdev) > +{ > + struct resource *mem_res;

Re: [PATCH V2 0/4] [SCSI] ufs: Adds glue drivers to ufshcd

2012-07-16 Thread James Bottomley
On Fri, 2012-07-13 at 15:45 +, Arnd Bergmann wrote: > On Friday 13 July 2012, Vinayak Holikatti wrote: > > This patch set adds following features > > - Seprates PCI specific code from ufshcd.c to make it as core > > - Adds PCI glue driver ufshcd-pci.c > > - Adds Platform glue driver ufshcd-p

[PATCH 0/2] virtio-scsi event changes for 3.6

2012-07-16 Thread Paolo Bonzini
Hi James, here are two more small patches for virtio-scsi. The first fixes a problem with the recently introduced hotplug/hot-unplug support (happens with LUNs whose number is greater than 255). The second introduces support for online resizing of disks. The host here will also send the sense c

[PATCH 2/2] virtio-scsi: support online resizing of disks

2012-07-16 Thread Paolo Bonzini
Support the LUN parameter change event. Currently, the host fires this event when the capacity of a disk is changed from the virtual machine monitor. The resize then appears in the kernel log like this: sd 0:0:0:0: [sda] 46137344 512-byte logical blocks: (23.6 GB/22.0 GIb) sda: detected capac

[PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-16 Thread Paolo Bonzini
Right now, I/O will fail as soon as a unit attention condition is detected on a unit with removable media. However, this is not always necessary. There are some cases (such as "Capacity data has changed") where no particular action is needed. On the other hand, all problematic cases have to repo

[PATCH 1/2] virtio-scsi: fix parsing of hotplug/hot-unplug LUN number

2012-07-16 Thread Paolo Bonzini
Hotplug/hot-unplug of a LUN whose number is greater than 255 uses the "flat" format for LUNs, which has bit 14 set. Clear the bit when parsing the event structs. Signed-off-by: Paolo Bonzini --- drivers/scsi/virtio_scsi.c |8 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-16 Thread James Bottomley
On Mon, 2012-07-16 at 18:06 +0200, Paolo Bonzini wrote: > Right now, I/O will fail as soon as a unit attention condition is > detected on a unit with removable media. However, this is not > always necessary. There are some cases (such as "Capacity data > has changed") where no particular action i

Re: [PATCH] sd: do not set changed flag on all unit attention conditions

2012-07-16 Thread Paolo Bonzini
Il 16/07/2012 18:18, James Bottomley ha scritto: >> > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c >> > index b583277..6d8ca08 100644 >> > --- a/drivers/scsi/scsi_lib.c >> > +++ b/drivers/scsi/scsi_lib.c >> > @@ -843,8 +843,11 @@ void scsi_io_completion(struct scsi_cmnd *cmd, >>

[PATCH 0/7] series to fix qla2xxx use-after-free

2012-07-16 Thread Roland Dreier
From: Roland Dreier Hi Nic, Here's a series that's fundamentally about fixing a use-after-free in qla_target code. It ends up being seven patches because I wanted to make each step easy to review, and several of these are just cleanups that stand on their own. We have a few more qla2xxx-relate

[PATCH 1/7] qla2xxx: Get rid of redundant qla_tgt_sess.tearing_down

2012-07-16 Thread Roland Dreier
From: Roland Dreier The only place that sets qla_tgt_sess.tearing_down calls target_splice_sess_cmd_list() immediately afterwards, without dropping the lock it holds. That function sets se_session.sess_tearing_down, so we can get rid of the qla_target-specific flag, and in the one place that loo

[PATCH 2/7] target: Un-export target_get_sess_cmd()

2012-07-16 Thread Roland Dreier
From: Roland Dreier There are no in-tree users of target_get_sess_cmd() outside of target_core_transport.c. Any new code should use the higher-level target_submit_cmd() interface. So let's un-export target_get_sess_cmd() and make it static to the one file where it's actually used. Signed-off-b

[PATCH 3/7] sbp-target: Consolidate duplicated error path code in sbp_handle_command()

2012-07-16 Thread Roland Dreier
From: Roland Dreier Cc: Chris Boot Cc: Stefan Richter Signed-off-by: Roland Dreier --- drivers/target/sbp/sbp_target.c | 28 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c index 7

[PATCH 5/7] target: Check sess_tearing_down in target_get_sess_cmd()

2012-07-16 Thread Roland Dreier
From: Roland Dreier Target core code assumes that target_splice_sess_cmd_list() has set sess_tearing_down and moved the list of pending commands to sess_wait_list, no more commands will be added to the session; if any are added, nothing keeps the se_session from being freed while the command is s

[PATCH 6/7] qla2xxx: Remove racy, now-redundant check of sess_tearing_down

2012-07-16 Thread Roland Dreier
From: Roland Dreier Now that target_submit_cmd() / target_get_sess_cmd() check sess_tearing_down before adding commands to the list, we no longer need the check in qlt_do_work(). In fact this check is racy anyway (and that race is what inspired the change to add the check of sess_tearing_down to

[PATCH 4/7] target: Allow for target_submit_cmd() returning errors

2012-07-16 Thread Roland Dreier
From: Roland Dreier We want it to be possible for target_submit_cmd() to return errors up to its fabric module callers. For now just update the prototype to return an int, and update all callers to handle non-zero return values as an error. Cc: Chad Dupuis Cc: Arun Easi Cc: Chris Boot Cc: St

[PATCH 7/7] target: Remove se_session.sess_wait_list

2012-07-16 Thread Roland Dreier
From: Roland Dreier Since we set se_session.sess_tearing_down and stop new commands from being added to se_session.sess_cmd_list before we wait for commands to finish when freeing a session, there's no need for a separate sess_wait_list -- if we let new commands be added to sess_cmd_list after se

Re: [PATCH V2 0/4] [SCSI] ufs: Adds glue drivers to ufshcd

2012-07-16 Thread Arnd Bergmann
On Monday 16 July 2012, James Bottomley wrote: > On Fri, 2012-07-13 at 15:45 +, Arnd Bergmann wrote: > > On Friday 13 July 2012, Vinayak Holikatti wrote: > > > This patch set adds following features > > > - Seprates PCI specific code from ufshcd.c to make it as core > > > - Adds PCI glue driv

[PATCH 3/3] ipr: Driver version 2.5.4

2012-07-16 Thread Brian King
Bump driver version. Signed-off-by: Brian King --- drivers/scsi/ipr.h |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/scsi/ipr.h~ipr_version_2_5_4 drivers/scsi/ipr.h --- linux-2.6/drivers/scsi/ipr.h~ipr_version_2_5_4 2012-07-11 16:40:34.0 -0500 +++

[PATCH 1/3] ipr: Reduce queuecommand lock time

2012-07-16 Thread Brian King
Reduce the amount of time the host lock is held in queuecommand for improved performance. Signed-off-by: Brian King --- drivers/scsi/ipr.c | 90 + 1 file changed, 63 insertions(+), 27 deletions(-) diff -puN drivers/scsi/ipr.c~ipr_reduce_lo

[PATCH 2/3] ipr: Reduce interrupt lock time

2012-07-16 Thread Brian King
Reduce the amount of time the host lock is held in the interrupt handler for improved performance. Signed-off-by: Brian King --- drivers/scsi/ipr.c | 60 - drivers/scsi/ipr.h |1 2 files changed, 47 insertions(+), 14 deletions(-) diff

Re: [PATCH 17/18] srp_transport: Add transport layer recovery support

2012-07-16 Thread Mike Christie
On 01/14/2012 05:56 AM, Bart Van Assche wrote: > Add the necessary functions in the SRP transport module to allow > an SRP initiator driver to implement transport layer recovery. > This includes: > - A ping mechanism to check whether the transport layer is still > operational. > - Support for imp

Re: [PATCH 13/15] ib_srp: Allow SRP disconnect through sysfs

2012-07-16 Thread Mike Christie
On 03/25/2012 09:01 AM, Bart Van Assche wrote: > +static void srp_rport_delete(struct srp_rport *rport) > +{ > + struct srp_target_port *target = rport->lld_data; > + > + BUG_ON(!target); > + I don't think this null check is needed, because below you set the lld_data before you call srp_rp

Re: [PATCH 17/18] srp_transport: Add transport layer recovery support

2012-07-16 Thread Mike Christie
On 07/16/2012 04:07 PM, Mike Christie wrote: > For the ping code, does it use TUR because there is not a transport way > to test the path/port/transport/interconnect? Maybe not transport as in SCSI transport method, but what about something similar to using a ICMP ping for testing the network with

Re: [PATCH 17/18] srp_transport: Add transport layer recovery support

2012-07-16 Thread David Dillow
On Mon, 2012-07-16 at 18:07 -0400, Mike Christie wrote: > On 01/14/2012 05:56 AM, Bart Van Assche wrote: > > Add the necessary functions in the SRP transport module to allow > > an SRP initiator driver to implement transport layer recovery. > > I was updating my iscsi dev loss patch when I saw this

Re: [PATCH 17/18] srp_transport: Add transport layer recovery support

2012-07-16 Thread Mike Christie
On 07/16/2012 04:28 PM, David Dillow wrote: > On Mon, 2012-07-16 at 18:07 -0400, Mike Christie wrote: >> On 01/14/2012 05:56 AM, Bart Van Assche wrote: >>> Add the necessary functions in the SRP transport module to allow >>> an SRP initiator driver to implement transport layer recovery. >> >> I was

Re: [PATCH 17/18] srp_transport: Add transport layer recovery support

2012-07-16 Thread David Dillow
On Mon, 2012-07-16 at 18:38 -0400, Mike Christie wrote: > On 07/16/2012 04:28 PM, David Dillow wrote: > > On Mon, 2012-07-16 at 18:07 -0400, Mike Christie wrote: > >> For the ping code, does it use TUR because there is not a transport way > >> to test the path/port/transport/interconnect? > > > >

Re: [PATCH 1/7] qla2xxx: Get rid of redundant qla_tgt_sess.tearing_down

2012-07-16 Thread Nicholas A. Bellinger
On Mon, 2012-07-16 at 11:04 -0700, Roland Dreier wrote: > From: Roland Dreier > > The only place that sets qla_tgt_sess.tearing_down calls > target_splice_sess_cmd_list() immediately afterwards, without dropping > the lock it holds. That function sets se_session.sess_tearing_down, > so we can ge

Re: [PATCH 2/7] target: Un-export target_get_sess_cmd()

2012-07-16 Thread Nicholas A. Bellinger
On Mon, 2012-07-16 at 11:04 -0700, Roland Dreier wrote: > From: Roland Dreier > > There are no in-tree users of target_get_sess_cmd() outside of > target_core_transport.c. Any new code should use the higher-level > target_submit_cmd() interface. So let's un-export target_get_sess_cmd() > and ma

Re: [PATCH 3/7] sbp-target: Consolidate duplicated error path code in sbp_handle_command()

2012-07-16 Thread Nicholas A. Bellinger
On Mon, 2012-07-16 at 11:04 -0700, Roland Dreier wrote: > From: Roland Dreier > > Cc: Chris Boot > Cc: Stefan Richter > Signed-off-by: Roland Dreier > --- > drivers/target/sbp/sbp_target.c | 28 > 1 file changed, 12 insertions(+), 16 deletions(-) > Looks like

Re: [PATCH 4/7] target: Allow for target_submit_cmd() returning errors

2012-07-16 Thread Nicholas A. Bellinger
On Mon, 2012-07-16 at 11:04 -0700, Roland Dreier wrote: > From: Roland Dreier > > We want it to be possible for target_submit_cmd() to return errors up > to its fabric module callers. For now just update the prototype to > return an int, and update all callers to handle non-zero return values >

Re: [PATCH 4/7] target: Allow for target_submit_cmd() returning errors

2012-07-16 Thread Roland Dreier
On Mon, Jul 16, 2012 at 4:00 PM, Nicholas A. Bellinger wrote: > Mmmm. The original target_submit_cmd() code had been propagating up a > return value, but then we decided (via Agrover's patch) that it made > more sense for target_submit_cmd() to always handle exceptions via > normal TFO callbacks,

Re: [PATCH 5/7] target: Check sess_tearing_down in target_get_sess_cmd()

2012-07-16 Thread Nicholas A. Bellinger
On Mon, 2012-07-16 at 11:04 -0700, Roland Dreier wrote: > From: Roland Dreier > > Target core code assumes that target_splice_sess_cmd_list() has set > sess_tearing_down and moved the list of pending commands to > sess_wait_list, no more commands will be added to the session; if any > are added,

Re: [PATCH 6/7] qla2xxx: Remove racy, now-redundant check of sess_tearing_down

2012-07-16 Thread Nicholas A. Bellinger
On Mon, 2012-07-16 at 11:04 -0700, Roland Dreier wrote: > From: Roland Dreier > > Now that target_submit_cmd() / target_get_sess_cmd() check > sess_tearing_down before adding commands to the list, we no longer > need the check in qlt_do_work(). In fact this check is racy anyway > (and that race

Re: [PATCH 7/7] target: Remove se_session.sess_wait_list

2012-07-16 Thread Nicholas A. Bellinger
On Mon, 2012-07-16 at 11:04 -0700, Roland Dreier wrote: > From: Roland Dreier > > Since we set se_session.sess_tearing_down and stop new commands from > being added to se_session.sess_cmd_list before we wait for commands to > finish when freeing a session, there's no need for a separate > sess_wa

Re: [PATCH 5/7] target: Check sess_tearing_down in target_get_sess_cmd()

2012-07-16 Thread Roland Dreier
On Mon, Jul 16, 2012 at 4:08 PM, Nicholas A. Bellinger wrote: > However, I'm still leaning towards a way to do this for tcm_qla2xxx that > does not require all fabric callers to handle target_submit_cmd() > exceptions directly.. > > How about a special target_get_sess_cmd() failure callback to fre

Re: [PATCH 4/7] target: Allow for target_submit_cmd() returning errors

2012-07-16 Thread Nicholas A. Bellinger
On Mon, 2012-07-16 at 16:05 -0700, Roland Dreier wrote: > On Mon, Jul 16, 2012 at 4:00 PM, Nicholas A. Bellinger > wrote: > > Mmmm. The original target_submit_cmd() code had been propagating up a > > return value, but then we decided (via Agrover's patch) that it made > > more sense for target_su

Re: [PATCH RESEND 0/3] scsi: fix internal write cache issue on usb hdd.

2012-07-16 Thread Greg KH
On Sat, Jul 07, 2012 at 11:04:45PM -0400, Namjae Jeon wrote: > From: Namjae Jeon > > The numbers of USB HDDs(All USB HDD I checked) does not respond > correctly to scsi mode sense command for retrieving the write cache > page status. Even though write cache is enabled by default, due to > scsi dr

Re: [PATCH 5/7] target: Check sess_tearing_down in target_get_sess_cmd()

2012-07-16 Thread Roland Dreier
> OK, I'll take a look at how you handle this... So looking at commit bc187ea6c3b3 in the tree you just pushed out ("target: Check sess_tearing_down in target_get_sess_cmd()") it looks like you just return from target_submit_cmd() if we fail to add the command to sess_cmd_list -- doesn't this mean

Re: [PATCH 5/7] target: Check sess_tearing_down in target_get_sess_cmd()

2012-07-16 Thread Nicholas A. Bellinger
On Mon, 2012-07-16 at 18:40 -0700, Roland Dreier wrote: > > OK, I'll take a look at how you handle this... > > So looking at commit bc187ea6c3b3 in the tree you just pushed out > ("target: Check sess_tearing_down in target_get_sess_cmd()") it looks > like you just return from target_submit_cmd() i

Re: [PATCH 5/7] target: Check sess_tearing_down in target_get_sess_cmd()

2012-07-16 Thread Nicholas A. Bellinger
On Mon, 2012-07-16 at 18:56 -0700, Nicholas A. Bellinger wrote: > On Mon, 2012-07-16 at 18:40 -0700, Roland Dreier wrote: > > > OK, I'll take a look at how you handle this... > > > > So looking at commit bc187ea6c3b3 in the tree you just pushed out > > ("target: Check sess_tearing_down in target_g

Re: [PATCH 1/3] ipr: Reduce queuecommand lock time

2012-07-16 Thread Matthew Wilcox
On Mon, Jul 16, 2012 at 03:48:08PM -0500, Brian King wrote: > +static int ipr_queuecommand(struct Scsi_Host *shost, > + struct scsi_cmnd *scsi_cmd) > { > struct ipr_ioa_cfg *ioa_cfg; > struct ipr_resource_entry *res; > struct ipr_ioarcb *ioarcb; > st

Re: [PATCH V2 3/4] [SCSI] ufs: Add Platform glue driver for ufshcd

2012-07-16 Thread vinayak holikatti
On Mon, Jul 16, 2012 at 7:19 PM, Namjae Jeon wrote: > Hi Vinayak. >> + * ufshcd_pltfrm_remove - remove platform driver routine >> + * @pdev: pointer to platform device handle >> + * >> + * Returns 0 on success, non-zero value on failure >> + */ >> +static int __devexit ufshcd_pltfrm_remove(struct