[patch] [SCSI] bfa: unlock on error in bfad_iocmd_cfg_trunk()

2012-10-11 Thread Dan Carpenter
We added a new return but forgot to drop the lock first. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com --- Bug introduced in e353546e [SCSI] bfa: Add diagnostic port (D-Port) support. diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c index 555e7db..91465b2 100644 ---

[patch] [SCSI] bfa: cleanup a memcpy()

2012-10-11 Thread Dan Carpenter
Smatch complains that we are writing more data than -srlid_base member can hold. In fact, we are over writing the whole struct. I've re-written it to be a bit more clear and to silence the static checker warning. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git

Re: [PATCH v7 2/6] scsi: sr: support runtime pm

2012-10-11 Thread Aaron Lu
On Tue, Oct 09, 2012 at 03:58:34PM +0100, James Bottomley wrote: On Tue, 2012-10-09 at 15:20 +0800, Aaron Lu wrote: On 10/08/2012 06:21 PM, James Bottomley wrote: On Mon, 2012-10-08 at 17:27 +0800, Aaron Lu wrote: On Sun, Sep 30, 2012 at 03:43:27PM -0400, Alan Stern wrote: On Sun, 30

Re: [PATCH 1/2] [SCSI] pm: use callbacks from dev_pm_ops for scsi devices

2012-10-11 Thread Aaron Lu
On Wed, Oct 10, 2012 at 02:32:13PM -0400, Alan Stern wrote: On Wed, 10 Oct 2012, Aaron Lu wrote: +static int run_dev_callback(struct device *dev, pm_message_t mesg) +{ + int ret; + + switch (mesg.event) { + case PM_EVENT_SUSPEND: + ret =

Re: [PATCH 2/2] [SCSI] sd: update sd to use the new pm callbacks

2012-10-11 Thread Aaron Lu
On Wed, Oct 10, 2012 at 02:35:47PM -0400, Alan Stern wrote: On Wed, 10 Oct 2012, Aaron Lu wrote: Update sd driver to use the callbacks defined in dev_pm_ops. sd_freeze is NULL, the bus level callback has taken care of quiescing the device so there should be nothing needs to be done

[RESEND PATCH] scsi: make struct scsi_varlen_cdb_hdr packed

2012-10-11 Thread James Hogan
The struct scsi_varlen_cdb_hdr is expected to be exactly 10 bytes when used in struct osd_cdb_head, but it isn't marked as packed. Some architectures will round the struct size up which triggers BUILD_BUG_ON compile errors in osd_initiator.c when the outer structs are unexpected sizes. This is

Re: [RESEND PATCH] scsi: make struct scsi_varlen_cdb_hdr packed

2012-10-11 Thread Bart Van Assche
On 10/11/12 11:15, James Hogan wrote: The struct scsi_varlen_cdb_hdr is expected to be exactly 10 bytes when used in struct osd_cdb_head, but it isn't marked as packed. Some architectures will round the struct size up which triggers BUILD_BUG_ON compile errors in osd_initiator.c when the outer

Re: [RESEND PATCH] scsi: make struct scsi_varlen_cdb_hdr packed

2012-10-11 Thread James Bottomley
On Thu, 2012-10-11 at 10:15 +0100, James Hogan wrote: The struct scsi_varlen_cdb_hdr is expected to be exactly 10 bytes when used in struct osd_cdb_head, but it isn't marked as packed. Some architectures will round the struct size up which triggers BUILD_BUG_ON compile errors in

Re: [RESEND PATCH] scsi: make struct scsi_varlen_cdb_hdr packed

2012-10-11 Thread James Hogan
On 11/10/12 11:01, Bart Van Assche wrote: On 10/11/12 11:15, James Hogan wrote: The struct scsi_varlen_cdb_hdr is expected to be exactly 10 bytes when used in struct osd_cdb_head, but it isn't marked as packed. Some architectures will round the struct size up which triggers BUILD_BUG_ON

Re: [RESEND PATCH] scsi: make struct scsi_varlen_cdb_hdr packed

2012-10-11 Thread James Hogan
On 11/10/12 11:24, James Bottomley wrote: On Thu, 2012-10-11 at 10:15 +0100, James Hogan wrote: The struct scsi_varlen_cdb_hdr is expected to be exactly 10 bytes when used in struct osd_cdb_head, but it isn't marked as packed. Some architectures will round the struct size up which triggers

Re: [RESEND PATCH] scsi: make struct scsi_varlen_cdb_hdr packed

2012-10-11 Thread Alan Cox
The alignment is fine (the offset of the u16 is 8 bytes), but unfortunately with the metag port of gcc, sizeof(struct scsi_varlen_cdb_hdr) is rounded up to a 4 byte boundary (even though the largest data member alignment is only 2 bytes), which is 12 bytes instead of 10. That sounds

Re: [RESEND PATCH] scsi: make struct scsi_varlen_cdb_hdr packed

2012-10-11 Thread James Hogan
On 11/10/12 13:58, James Bottomley wrote: On Thu, 2012-10-11 at 12:32 +0100, James Hogan wrote: On 11/10/12 11:24, James Bottomley wrote: On Thu, 2012-10-11 at 10:15 +0100, James Hogan wrote: The struct scsi_varlen_cdb_hdr is expected to be exactly 10 bytes when used in struct osd_cdb_head,

Re: [PATCH v2 1/5] sd: put to stopped power state when runtime suspend

2012-10-11 Thread Alan Stern
On Thu, 11 Oct 2012, Aaron Lu wrote: When device is runtime suspended, put it to stopped power state to save some power. This will also make the behaviour consistent with what the scsi_pm.c thinks about sd as the comment says: sd treats runtime suspend, system suspend and system hibernate

Re: [PATCH v2 4/5] pm: use callbacks from dev_pm_ops for scsi devices

2012-10-11 Thread Alan Stern
I have a couple of small changes to suggest. Nothing major. On Thu, 11 Oct 2012, Aaron Lu wrote: @@ -102,26 +77,87 @@ static int scsi_bus_prepare(struct device *dev) static int scsi_bus_suspend(struct device *dev) { - return scsi_bus_suspend_common(dev, PMSG_SUSPEND); + int

[PATCH 0/2] qla2xxx target fixes

2012-10-11 Thread Roland Dreier
From: Roland Dreier rol...@purestorage.com Hi everyone, a couple of qla2xxx target fixes that we've been shipping for a while at Pure and that I've finally got around to cleaning up and merging to the latest kernel tree... Roland Dreier (2): tcm_qla2xxx: Format VPD page 83h SCSI name string

[PATCH 1/2] tcm_qla2xxx: Format VPD page 83h SCSI name string according to SPC

2012-10-11 Thread Roland Dreier
From: Roland Dreier rol...@purestorage.com My draft of SPC-4 says the following about the SCSI name string in inquiry VPD page 83h: The SCSI NAME STRING field starts with either: a) the four UTF-8 characters 'eui.' concatenated with 16, 24, or 32 hexadecimal digits (i.e., the

[PATCH 2/2] qla2xxx: Update target lookup session tables when a target session changes

2012-10-11 Thread Roland Dreier
From: Roland Dreier rol...@purestorage.com It is possible for the target code to change the loop_id or s_id of a target session in reaction to an FC fabric change. However, the session structures are stored in tables that are indexed by these two keys, and if we just change the session structure