Re: [PATCH] scsi: ufs: select CONFIG_NLS

2016-03-19 Thread Martin K. Petersen
> "Arnd" == Arnd Bergmann  writes:

Arnd> A recent change to ufshcd introduced a call to utf16s_to_utf8s, a
Arnd> function that is provided by the NLS module, so we get a link
Arnd> error when that is not present:

Applied to 4.6/scsi-fixes.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

--- Comment #7 from nickkra...@sympatico.ca ---
The kernel log or the bug log.

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[no subject]

2016-03-19 Thread MS. LIRA MANDOZA
I have not heard from you. I hope everything is fine.


Mrs Lira Mandoza.rtf
Description: MS-Word document


privat donation

2016-03-19 Thread Wang Jianlin



--
Hallå
Jag har för avsikt att ge dig en del av min rikedom som en fri vilja
finansiell donation till dig. Svara på delta
Wang Jianlin
Wanda Group
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


UFS V11 patch-set

2016-03-19 Thread Joao Pinto
Hi!

Could you please check the following patch-set in order to evaluate if it is
ready for v4.6?

[PATCH v11 0/6] add support for DWC UFS Controller
http://www.gossamer-threads.com/lists/linux/kernel/2396797?#2396797

[PATCH v11 1/6] fixed typo in ufshcd-pltfrm
http://www.gossamer-threads.com/lists/linux/kernel/2396790?#2396790

[PATCH v11 2/6] added UFS 2.0 capabilities
http://www.gossamer-threads.com/lists/linux/kernel/2396791?#2396791

[PATCH v11 3/6] added support for DesignWare Controller
http://www.gossamer-threads.com/lists/linux/kernel/2396795?#2396795

[PATCH v11 4/6] added support for Synopsys G210 Test Chip
http://www.gossamer-threads.com/lists/linux/kernel/2396792?#2396792

[PATCH v11 5/6] add TC G210 platform driver
http://www.gossamer-threads.com/lists/linux/kernel/2396794?#2396794

[PATCH v11 6/6] add-TC-G210-pci-driver
http://www.gossamer-threads.com/lists/linux/kernel/2396793?#2396793

Thank you very much!

Regards,
Joao

PS: Changed JBottomley e-mail address.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

Adam Radford  changed:

   What|Removed |Added

 CC||aradf...@gmail.com

--- Comment #17 from Adam Radford  ---
I think Christoph Hellwig already fixed this issue in the upstream kernel, with
these 2 upstream patches:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=118c855b5623f3e2e6204f02623d88c09e0c34de

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=15e3d5a285ab9283136dba34bbf72886d9146706

I would apply the above 2 patches to your kernel and try to reproduce.

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] Fix to cleanup aborted IO to avoid device being offlined by mid-layer

2016-03-19 Thread Ewan D. Milne
On Wed, 2016-03-16 at 22:38 +, Satish Kharat (satishkh) wrote:
> Thanks for the review comments. I incorporated the comments, below is the 
> updated patch: 
> 
> 
> If an I/O times out and an abort issued by host, if the abort is
> successful we need to set scsi status as DID_ABORT. Or else the
> mid-layer error handler which looks for this error code, will
> offline the device. Also if the original I/O is not found in fnic
> firmware, we will consider the abort as successful.
> The start_time assignment is moved because of the new goto.
> Fnic driver version changed from 1.6.0.17a to 1.6.0.19,
> version 1.6.0.18 has been skipped
> 
> Signed-off-by: Satish Kharat 
> ---
>  drivers/scsi/fnic/fnic.h  |  2 +-
>  drivers/scsi/fnic/fnic_scsi.c | 35 +--
>  2 files changed, 30 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/scsi/fnic/fnic.h b/drivers/scsi/fnic/fnic.h
> index ce129e5..52a53f8 100644
> --- a/drivers/scsi/fnic/fnic.h
> +++ b/drivers/scsi/fnic/fnic.h
> @@ -39,7 +39,7 @@
>  
>  #define DRV_NAME "fnic"
>  #define DRV_DESCRIPTION  "Cisco FCoE HBA Driver"
> -#define DRV_VERSION  "1.6.0.17a"
> +#define DRV_VERSION  "1.6.0.19"
>  #define PFX  DRV_NAME ": "
>  #define DFX DRV_NAME "%d: "
>  
> diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
> index 266b909..b732fa3 100644
> --- a/drivers/scsi/fnic/fnic_scsi.c
> +++ b/drivers/scsi/fnic/fnic_scsi.c
> @@ -1092,6 +1092,11 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic 
> *fnic,
>   atomic64_inc(
>   _stats->terminate_fw_timeouts);
>   break;
> + case FCPIO_ITMF_REJECTED:
> + FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host,
> + "abort reject recd. id %d\n",
> + (int)(id & FNIC_TAG_MASK));
> + break;
>   case FCPIO_IO_NOT_FOUND:
>   if (CMD_FLAGS(sc) & FNIC_IO_ABTS_ISSUED)
>   atomic64_inc(_stats->abort_io_not_found);
> @@ -1112,9 +1117,15 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic 
> *fnic,
>   spin_unlock_irqrestore(io_lock, flags);
>   return;
>   }
> - CMD_ABTS_STATUS(sc) = hdr_status;
> +
>   CMD_FLAGS(sc) |= FNIC_IO_ABT_TERM_DONE;
>  
> + /* If the status is IO not found consider it as success */
> + if (hdr_status == FCPIO_IO_NOT_FOUND)
> + CMD_ABTS_STATUS(sc) = FCPIO_SUCCESS;
> + else
> + CMD_ABTS_STATUS(sc) = hdr_status;
> +
>   atomic64_dec(_stats->io_stats.active_ios);
>   if (atomic64_read(>io_cmpl_skip))
>   atomic64_dec(>io_cmpl_skip);
> @@ -1927,21 +1938,33 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
>  
>   CMD_STATE(sc) = FNIC_IOREQ_ABTS_COMPLETE;
>  
> + start_time = io_req->start_time;
>   /*
>* firmware completed the abort, check the status,
> -  * free the io_req irrespective of failure or success
> +  * free the io_req if successful. If abort fails,
> +  * Device reset will clean the I/O.
>*/
> - if (CMD_ABTS_STATUS(sc) != FCPIO_SUCCESS)
> + if (CMD_ABTS_STATUS(sc) == FCPIO_SUCCESS) {
> + CMD_SP(sc) = NULL;
> + }
> + else
> + {
>   ret = FAILED;
> -
> - CMD_SP(sc) = NULL;
> + spin_unlock_irqrestore(io_lock, flags);
> + goto fnic_abort_cmd_end;
> + }
>  
>   spin_unlock_irqrestore(io_lock, flags);
>  
> - start_time = io_req->start_time;
>   fnic_release_ioreq_buf(fnic, io_req, sc);
>   mempool_free(io_req, fnic->io_req_pool);
>  
> + if (sc->scsi_done) {
> + /* Call SCSI completion function to complete the IO */
> + sc->result = (DID_ABORT << 16);
> + sc->scsi_done(sc);
> + }
> +
>  fnic_abort_cmd_end:
>   FNIC_TRACE(fnic_abort_cmd, sc->device->host->host_no,
> sc->request->tag, sc,
> -- 
> 2.4.3

Reviewed-by: Ewan D. Milne 

> 
> 
> From: Ewan Milne 
> Sent: Monday, March 14, 2016 12:59 PM
> To: Satish Kharat (satishkh)
> Cc: linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 1/5] Fix to cleanup aborted IO to avoid device being 
> offlined by mid-layer
> 
> On Mon, 2016-03-14 at 11:14 -0700, Satish Kharat wrote:
> > If an I/O times out and an abort issued by host, if the abort is
> > successful we need to set scsi status as DID_ABORT. Or else the
> > mid-layer error handler which looks for this error code, will
> > offline the device. Also if the original I/O is not found in fnic
> > firmware, we will consider the abort as successful.
> > Fnic driver 

[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

--- Comment #9 from Orion  ---
just today my data center blocked my server where the card is
because of invoice contentious... a kind of conspiracy against my project

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 1/3] aacraid: add missing curly braces

2016-03-19 Thread Raghava Aditya Renukunta

> -Original Message-
> From: Arnd Bergmann [mailto:a...@arndb.de]
> Sent: Monday, March 14, 2016 7:30 AM
> To: martin.peter...@oracle.com;
> james.bottom...@hansenpartnership.com; Adaptec OEM Raid Solutions;
> James E.J. Bottomley
> Cc: linux-scsi@vger.kernel.org; linux-ker...@vger.kernel.org; Arnd
> Bergmann; Johannes Thumshirn; Tomas Henzl; Mahesh Rajashekhara;
> Raghava Aditya Renukunta; Fengguang Wu
> Subject: [PATCH 1/3] aacraid: add missing curly braces
> 
> gcc-6 warns about obviously wrong indentation for newly added
> code in aac_slave_configure():
> 
> drivers/scsi/aacraid/linit.c: In function 'aac_slave_configure':
> drivers/scsi/aacraid/linit.c:458:3: warning: statement is indented as if it 
> were
> guarded by... [-Wmisleading-indentation]
>sdev->tagged_supported = 1;
>^~~~
> drivers/scsi/aacraid/linit.c:455:4: note: ...this 'else' clause, but it is not
> 
> gcc is correct, and evidently this was meant to be within the curly
> braces that should have been there to start with. This patch adds
> them, which avoids the warning and makes it clear what was intended
> here.
> 
> Nothing changes in behavior because in the 'if' block, the
> sdev->tagged_supported flag is known to be set already.
> 
> Signed-off-by: Arnd Bergmann 
> Fixes: 6bf3b630d0a7 ("aacraid: SCSI blk tag support")
> ---
>  drivers/scsi/aacraid/linit.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
> index 21a67ed047e8..ff6caab8cc8b 100644
> --- a/drivers/scsi/aacraid/linit.c
> +++ b/drivers/scsi/aacraid/linit.c
> @@ -452,10 +452,11 @@ static int aac_slave_configure(struct scsi_device
> *sdev)
>   else if (depth < 2)
>   depth = 2;
>   scsi_change_queue_depth(sdev, depth);
> - } else
> + } else {
>   scsi_change_queue_depth(sdev, 1);
>   sdev->tagged_supported = 1;
> + }
> 
>   return 0;
>  }
> --
> 2.7.0

Reviewed-by: Raghava Aditya Renukunta < raghavaaditya.renuku...@pmcs.com >

Regards,
Raghava Aditya

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


UFS V11 patch-set

2016-03-19 Thread Joao Pinto
Hi!

Could you please check the following patch-set in order to evaluate if it is
ready for v4.6?

[PATCH v11 0/6] add support for DWC UFS Controller
http://www.gossamer-threads.com/lists/linux/kernel/2396797?#2396797

[PATCH v11 1/6] fixed typo in ufshcd-pltfrm
http://www.gossamer-threads.com/lists/linux/kernel/2396790?#2396790

[PATCH v11 2/6] added UFS 2.0 capabilities
http://www.gossamer-threads.com/lists/linux/kernel/2396791?#2396791

[PATCH v11 3/6] added support for DesignWare Controller
http://www.gossamer-threads.com/lists/linux/kernel/2396795?#2396795

[PATCH v11 4/6] added support for Synopsys G210 Test Chip
http://www.gossamer-threads.com/lists/linux/kernel/2396792?#2396792

[PATCH v11 5/6] add TC G210 platform driver
http://www.gossamer-threads.com/lists/linux/kernel/2396794?#2396794

[PATCH v11 6/6] add-TC-G210-pci-driver
http://www.gossamer-threads.com/lists/linux/kernel/2396793?#2396793

Thank you very much!

Regards,
Joao
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] scsi: storvsc: Support manual scan of FC hosts on Hyper-V

2016-03-19 Thread Martin K. Petersen
> "KY" == KY Srinivasan  writes:

KY> How would I get the sysfs files under fc_host if I don't use the FC
KY> transport.  The customer scripts expect these sysfs files.

Right, but I was interested in finding out why they need those
files. And whether an alternative to the FC transport would be a better
solution.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

--- Comment #11 from Orion  ---
I just had time yesterday to check the log and see that the errors disappear.
today no ssh access at all. anyhow it's months now they are creating troubles
against me so I just give up and ask my money back next week.
cheers

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] libata: Set longer timeout for SETFEATURES_SPINUP

2016-03-19 Thread Hannes Reinecke
On 03/18/2016 05:49 AM, Damien Le Moal wrote:
> 
> libata: Set longer timeout for SETFEATURES_SPINUP
> 
> For SATA drives with power-up in standby (PUIS) feature set,
> SETFEATURES_SPINUP execution may be required to get
> complete IDENTIFY data. However, the timeout used for its
> execution is the same as for all other SETFEATURES commands,
> that is, 5 seconds. This is too short for some disks to complete
> timeout and allow IDENTIFY to return complete data (e.g.
> disks with large indirection tables stored on media), resulting
> in ata_dev_read_id to fail. For this feature, allow a larger
> timeout of 30 seconds.
> 
Reviewed-by: Hannes Reinecke 

(BTW, you might want to add your Signed-off-by:, too :-)

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: QoS for iSCSI target?

2016-03-19 Thread Chris Friesen

On 03/11/2016 01:45 AM, Nicholas A. Bellinger wrote:

On Thu, 2016-03-10 at 23:30 -0800, Christoph Hellwig wrote:

On Thu, Mar 10, 2016 at 04:24:25PM -0600, Chris Friesen wrote:

Hi,

I'm looking for information on whether the iSCSI target in the kernel offers
any way to do QoS between traffic driven by different initiators.

I'm trying to make sure that one initiator can't do a denial-of-service
attack against others.

Does the kernel target have this sort of thing built-in, or do I need to
look at network traffic-shaping to achieve this?


It doesn't right now, but it shouldn't be hard to integrate it with
blk cgroups.


For iscsi-target application QoS, the per session command sequence
number window depth (CmdSN) exists to enforce per InitiatorName limits
via TPG default_cmdsn_depth + se_node_acl->queue_depth configfs
attributes.

Note these values can be changed on the fly for iscsi-target using
explicit se_node_acl->acl_group, but currently require a se_session
reinstatement event for updated ExpCmdSN + MaxCmdSN to take effect.


On a slightly different note, is there any way to throttle or limit the overall 
bandwidth consumed by the iSCSI target in the kernel?  I'd like to ensure that 
the iSCSI traffic doesn't completely swamp the host accesses to the same block 
device.


I suppose I could do networking-based traffic shaping, but are there any 
controls in the block IO subsystem?


Chris

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/8] snic: Handling control path queue issues

2016-03-19 Thread Narsimhulu Musini
Fix handles control path queue issues such as queue full, and
sudden removal of hardware.

Signed-off-by: Narsimhulu Musini 
Signed-off-by: Sesidhar Baddela 
---
 drivers/scsi/snic/vnic_dev.c | 44 ++--
 1 file changed, 30 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/snic/vnic_dev.c b/drivers/scsi/snic/vnic_dev.c
index e0b5549..dad5fc6 100644
--- a/drivers/scsi/snic/vnic_dev.c
+++ b/drivers/scsi/snic/vnic_dev.c
@@ -263,12 +263,20 @@ static int _svnic_dev_cmd2(struct vnic_dev *vdev, enum 
vnic_devcmd_cmd cmd,
int wait)
 {
struct devcmd2_controller *dc2c = vdev->devcmd2;
-   struct devcmd2_result *result = dc2c->result + dc2c->next_result;
+   struct devcmd2_result *result = NULL;
unsigned int i;
int delay;
int err;
u32 posted;
+   u32 fetch_idx;
u32 new_posted;
+   u8 color;
+
+   fetch_idx = ioread32(>wq_ctrl->fetch_index);
+   if (fetch_idx == 0x) { /* check for hardware gone  */
+   /* Hardware surprise removal: return error */
+   return -ENODEV;
+   }
 
posted = ioread32(>wq_ctrl->posted_index);
 
@@ -278,6 +286,13 @@ static int _svnic_dev_cmd2(struct vnic_dev *vdev, enum 
vnic_devcmd_cmd cmd,
}
 
new_posted = (posted + 1) % DEVCMD2_RING_SIZE;
+   if (new_posted == fetch_idx) {
+   pr_err("%s: wq is full while issuing devcmd2 command %d, fetch 
index: %u, posted index: %u\n",
+   pci_name(vdev->pdev), _CMD_N(cmd), fetch_idx, posted);
+
+   return -EBUSY;
+   }
+
dc2c->cmd_ring[posted].cmd = cmd;
dc2c->cmd_ring[posted].flags = 0;
 
@@ -299,14 +314,22 @@ static int _svnic_dev_cmd2(struct vnic_dev *vdev, enum 
vnic_devcmd_cmd cmd,
if (dc2c->cmd_ring[posted].flags & DEVCMD2_FNORESULT)
return 0;
 
+   result = dc2c->result + dc2c->next_result;
+   color = dc2c->color;
+
+   /*
+* Increment next_result, after posting the devcmd, irrespective of
+* devcmd result, and it should be done only once.
+*/
+   dc2c->next_result++;
+   if (dc2c->next_result == dc2c->result_size) {
+   dc2c->next_result = 0;
+   dc2c->color = dc2c->color ? 0 : 1;
+   }
+
for (delay = 0; delay < wait; delay++) {
udelay(100);
-   if (result->color == dc2c->color) {
-   dc2c->next_result++;
-   if (dc2c->next_result == dc2c->result_size) {
-   dc2c->next_result = 0;
-   dc2c->color = dc2c->color ? 0 : 1;
-   }
+   if (result->color == color) {
if (result->error) {
err = (int) result->error;
if (err != ERR_ECMDUNKNOWN ||
@@ -317,13 +340,6 @@ static int _svnic_dev_cmd2(struct vnic_dev *vdev, enum 
vnic_devcmd_cmd cmd,
return err;
}
if (_CMD_DIR(cmd) & _CMD_DIR_READ) {
-   /*
-* Adding the rmb() prevents the compiler
-* and/or CPU from reordering the reads which
-* would potentially result in reading stale
-* values.
-*/
-   rmb();
for (i = 0; i < VNIC_DEVCMD_NARGS; i++)
vdev->args[i] = result->results[i];
}
-- 
1.8.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] scsi: storvsc: Support manual scan of FC hosts on Hyper-V

2016-03-19 Thread James Bottomley
On Thu, 2016-03-17 at 00:01 +, KY Srinivasan wrote:
> The only attributes I would be interested are:
> 1) node name
> 2) port name
> 
> Ideally, if this can show under /sys/class/fc_host/hostx/port_name
> and node_name,
> it will be ideal since all user scripts can work.

OK, like this?

>From 7af7c428e7e04ddcc87fda12d6571e3dff8ae024 Mon Sep 17 00:00:00 2001
From: James Bottomley 
Date: Fri, 18 Mar 2016 15:35:45 -0700
Subject: scsi_transport_fc: introduce lightweight class for virtualization
 systems

The FC transport class is very heavily tilted towards helping things
which operate a fabric (as it should be).  However, there seems to be
a need for a lightweight version for use in virtual systems that
simply want to show pass through FC information without making any use
of the heavyweight functions.  This is an attempt to give them what
they want: the lightweight class has no vports or rports and only two
host attributes.  Essentially, it's designed for the HV storvsc
driver, but if other virtualizataion systems have similar problems, we
can add more attributes.

Signed-off-by: James Bottomley 
---
 drivers/scsi/scsi_transport_fc.c | 94 
 include/scsi/scsi_transport_fc.h |  3 ++
 2 files changed, 97 insertions(+)

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 8a88226..a9fcb4d 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -351,6 +351,27 @@ struct fc_internal {
 
 #define to_fc_internal(tmpl)   container_of(tmpl, struct fc_internal, t)
 
+#define FC_LW_HOST_NUM_ATTRS   2
+struct fc_lw_internal {
+   struct scsi_transport_template t;
+   struct fc_function_template *f;
+
+   /*
+* For attributes : each object has :
+*   An array of the actual attributes structures
+*   An array of null-terminated pointers to the attribute
+* structures - used for mid-layer interaction.
+*
+* The attribute containers for the starget and host are are
+* part of the midlayer. As the remote port is specific to the
+* fc transport, we must provide the attribute container.
+*/
+   struct device_attribute private_host_attrs[FC_LW_HOST_NUM_ATTRS];
+   struct device_attribute *host_attrs[FC_LW_HOST_NUM_ATTRS + 1];
+};
+
+#define to_fc_lw_internal(tmpl)container_of(tmpl, struct 
fc_lw_internal, t)
+
 static int fc_target_setup(struct transport_container *tc, struct device *dev,
   struct device *cdev)
 {
@@ -472,6 +493,12 @@ static int fc_host_remove(struct transport_container *tc, 
struct device *dev,
return 0;
 }
 
+static DECLARE_TRANSPORT_CLASS(fc_lw_host_class,
+  "fc_host",
+  NULL,
+  NULL,
+  NULL);
+
 static DECLARE_TRANSPORT_CLASS(fc_host_class,
   "fc_host",
   fc_host_setup,
@@ -1968,6 +1995,25 @@ static int fc_host_match(struct attribute_container 
*cont,
return >t.host_attrs.ac == cont;
 }
 
+static int fc_lw_host_match(struct attribute_container *cont,
+ struct device *dev)
+{
+   struct Scsi_Host *shost;
+   struct fc_lw_internal *i;
+
+   if (!scsi_is_host_device(dev))
+   return 0;
+
+   shost = dev_to_shost(dev);
+   if (!shost->transportt  || shost->transportt->host_attrs.ac.class
+   != _lw_host_class.class)
+   return 0;
+
+   i = to_fc_lw_internal(shost->transportt);
+
+   return >t.host_attrs.ac == cont;
+}
+
 static int fc_target_match(struct attribute_container *cont,
struct device *dev)
 {
@@ -2171,6 +2217,54 @@ static int fc_it_nexus_response(struct Scsi_Host *shost, 
u64 nexus, int result)
return i->f->it_nexus_response(shost, nexus, result);
 }
 
+/**
+ * fc_attach_lw_transport - light weight attach function
+ * @ft:function template for optional attributes
+ *
+ * This attach function is to be used only for virtual FC emulators
+ * which do not have a physical fabric underneath them and thus only
+ * need a few attributes and no helper functions
+ */
+struct scsi_transport_template *
+fc_lw_attach_transport(struct fc_function_template *ft)
+{
+   int count;
+   struct fc_lw_internal *i = kzalloc(sizeof(struct fc_lw_internal),
+  GFP_KERNEL);
+
+   if (unlikely(!i))
+   return NULL;
+
+   i->t.host_attrs.ac.attrs = >host_attrs[0];
+   i->t.host_attrs.ac.class = _lw_host_class.class;
+   i->t.host_attrs.ac.match = fc_lw_host_match;
+   i->t.host_size = sizeof(struct fc_host_attrs);
+   transport_container_register(>t.host_attrs);
+
+   i->f = ft;
+
+   count = 0;
+   

[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

--- Comment #19 from Orion  ---
Unfortunately for now my DC blocked all ssh access and I'm afraid it's for a
long time...

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning

2016-03-19 Thread Ewan D. Milne
On Wed, 2016-03-16 at 16:03 +0100, Tomas Henzl wrote:
> On 15.3.2016 22:40, Arnd Bergmann wrote:
> > The qlt_check_reserve_free_req() function produces an incorrect warning
> > when CONFIG_PROFILE_ANNOTATED_BRANCHES is set:
> >
> > drivers/scsi/qla2xxx/qla_target.c: In function 'qlt_check_reserve_free_req':
> > drivers/scsi/qla2xxx/qla_target.c:1887:3: error: 'cnt_in' may be used 
> > uninitialized in this function [-Werror=maybe-uninitialized]
> >ql_dbg(ql_dbg_io, vha, 0x305a,
> >^~
> >"qla_target(%d): There is no room in the request ring: 
> > vha->req->ring_index=%d, vha->req->cnt=%d, req_cnt=%d Req-out=%d Req-in=%d 
> > Req-Length=%d\n",
> >
> > ~~~
> >vha->vp_idx, vha->req->ring_index,
> >~~
> >vha->req->cnt, req_cnt, cnt, cnt_in, vha->req->length);
> >~~
> > drivers/scsi/qla2xxx/qla_target.c:1887:3: error: 'cnt' may be used 
> > uninitialized in this function [-Werror=maybe-uninitialized]
> >
> > The problem is that gcc fails to track the state of the condition across
> > an annotated branch.
> >
> > This slightly rearranges the code to move the second if() block
> > into the first one, to avoid the warning while retaining the
> > behavior of the code.
> 
> When the first 'if' is true the vha->req->ring_index gets a new value 
> assigned - so it could be possible that the second 'if' wont be true any more.
> The code should not be merged into that single 'if', or am I missing 
> something?
> 
> tomash

If the first "if" is false, the second "if" will be false also, because
the vha->req->cnt value has not changed.  If the first "if" is true, the
nested second "if" will retest the condition.

The compiler is not at fault, because vha->req->cnt can't be tracked as
it could be modified by another thread/process.  It isn't, it's protected
by the ->hardware_lock, but the compiler doesn't know that.

-Ewan

> >
> > Signed-off-by: Arnd Bergmann 
> > ---
> >  drivers/scsi/qla2xxx/qla_target.c | 16 +---
> >  1 file changed, 9 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/scsi/qla2xxx/qla_target.c 
> > b/drivers/scsi/qla2xxx/qla_target.c
> > index 985231900aca..8a44d1541eb4 100644
> > --- a/drivers/scsi/qla2xxx/qla_target.c
> > +++ b/drivers/scsi/qla2xxx/qla_target.c
> > @@ -1881,15 +1881,17 @@ static int qlt_check_reserve_free_req(struct 
> > scsi_qla_host *vha,
> > else
> > vha->req->cnt = vha->req->length -
> > (vha->req->ring_index - cnt);
> > -   }
> >  
> > -   if (unlikely(vha->req->cnt < (req_cnt + 2))) {
> > -   ql_dbg(ql_dbg_io, vha, 0x305a,
> > -   "qla_target(%d): There is no room in the request ring: 
> > vha->req->ring_index=%d, vha->req->cnt=%d, req_cnt=%d Req-out=%d Req-in=%d 
> > Req-Length=%d\n",
> > -   vha->vp_idx, vha->req->ring_index,
> > -   vha->req->cnt, req_cnt, cnt, cnt_in, vha->req->length);
> > -   return -EAGAIN;
> > +   if (unlikely(vha->req->cnt < (req_cnt + 2))) {
> > +   ql_dbg(ql_dbg_io, vha, 0x305a,
> > +   "qla_target(%d): There is no room in the request 
> > ring: vha->req->ring_index=%d, vha->req->cnt=%d, req_cnt=%d Req-out=%d 
> > Req-in=%d Req-Length=%d\n",
> > +   vha->vp_idx, vha->req->ring_index,
> > +   vha->req->cnt, req_cnt, cnt, cnt_in,
> > +   vha->req->length);
> > +   return -EAGAIN;
> > +   }
> > }
> > +
> > vha->req->cnt -= req_cnt;
> >  
> > return 0;
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 8/8] snic: updating driver version

2016-03-19 Thread Narsimhulu Musini
updated driver version to 0.0.1.26

Signed-off-by: Narsimhulu Musini 
Signed-off-by: Sesidhar Baddela 
---
 drivers/scsi/snic/snic.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/snic/snic.h b/drivers/scsi/snic/snic.h
index 8ed778d..31cb20b 100644
--- a/drivers/scsi/snic/snic.h
+++ b/drivers/scsi/snic/snic.h
@@ -41,7 +41,7 @@
 
 #define SNIC_DRV_NAME  "snic"
 #define SNIC_DRV_DESCRIPTION   "Cisco SCSI NIC Driver"
-#define SNIC_DRV_VERSION   "0.0.1.18"
+#define SNIC_DRV_VERSION   "0.0.1.26"
 #define PFXSNIC_DRV_NAME ":"
 #define DFXSNIC_DRV_NAME "%d: "
 
-- 
1.8.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] scsi: ufs: select CONFIG_NLS

2016-03-19 Thread Arnd Bergmann
A recent change to ufshcd introduced a call to utf16s_to_utf8s,
a function that is provided by the NLS module, so we get a link
error when that is not present:

drivers/scsi/built-in.o: In function `ufshcd_read_string_desc':
:(.text+0x124d0): undefined reference to `utf16s_to_utf8s'

This adds a Kconfig 'select' statement to avoid the build error.

Signed-off-by: Arnd Bergmann 
Fixes: b573d484e4ff ("scsi: ufs: add support to read device and string 
descriptors")
---
 drivers/scsi/ufs/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig
index 5f4530744e0a..097894a1fab5 100644
--- a/drivers/scsi/ufs/Kconfig
+++ b/drivers/scsi/ufs/Kconfig
@@ -37,6 +37,7 @@ config SCSI_UFSHCD
depends on SCSI && SCSI_DMA
select PM_DEVFREQ
select DEVFREQ_GOV_SIMPLE_ONDEMAND
+   select NLS
---help---
This selects the support for UFS devices in Linux, say Y and make
  sure that you know the name of your UFS host adapter (the card
-- 
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] scsi_common: do not clobber fixed sense information

2016-03-19 Thread Ewan D. Milne
On Fri, 2016-03-18 at 09:01 +0100, Hannes Reinecke wrote:
> For fixed sense the information field is 32 bits, to we need
> to truncate the information field to avoid clobbering the
> sense code.
> 
> Signed-off-by: Hannes Reinecke 
> ---
>  drivers/scsi/scsi_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c
> index c126966..3459009 100644
> --- a/drivers/scsi/scsi_common.c
> +++ b/drivers/scsi/scsi_common.c
> @@ -279,7 +279,7 @@ int scsi_set_sense_information(u8 *buf, int buf_len, u64 
> info)
>   put_unaligned_be64(info, [4]);
>   } else if ((buf[0] & 0x7f) == 0x70) {
>   buf[0] |= 0x80;
> - put_unaligned_be64(info, [3]);
> + put_unaligned_be32((u32)info, [3]);
>   }
>  
>   return 0;

Well, not clobbering the ADDITIONAL SENSE LENGTH field is good,
however according to SPC-5 what we are really supposed to do here
is not set the VALID bit (buf[0] |= 0x80) if the value to be
returned can't be represented in 32 bits (and set the INFORMATION
field to a "vendor specific" value, whatever that means).

I'm not a T10 member so I don't have immediate access to what the
earlier SPC revisions say.

Reviewed-by: Ewan D. Milne 


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] libata: Set longer timeout for SETFEATURES_SPINUP

2016-03-19 Thread Damien Le Moal

libata: Set longer timeout for SETFEATURES_SPINUP

For SATA drives with power-up in standby (PUIS) feature set,
SETFEATURES_SPINUP execution may be required to get
complete IDENTIFY data. However, the timeout used for its
execution is the same as for all other SETFEATURES commands,
that is, 5 seconds. This is too short for some disks to complete
timeout and allow IDENTIFY to return complete data (e.g.
disks with large indirection tables stored on media), resulting
in ata_dev_read_id to fail. For this feature, allow a larger
timeout of 30 seconds.

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index e83fc3d..ecbbee2 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4537,7 +4537,8 @@ unsigned int ata_dev_set_feature(struct ata_device *dev, 
u8 enable, u8 feature)
tf.protocol = ATA_PROT_NODATA;
tf.nsect = feature;
 
-   err_mask = ata_exec_internal(dev, , NULL, DMA_NONE, NULL, 0, 0);
+   err_mask = ata_exec_internal(dev, , NULL, DMA_NONE, NULL, 0,
+enable == SETFEATURES_SPINUP ? 
SETFEATURES_SPINUP_TIMEOUT : 0);
 
DPRINTK("EXIT, err_mask=%x\n", err_mask);
return err_mask;
diff --git a/include/linux/ata.h b/include/linux/ata.h
index fed3641..e3a9ab6 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -371,6 +371,7 @@ enum {
SETFEATURES_AAM_OFF = 0xC2,
 
SETFEATURES_SPINUP  = 0x07, /* Spin-up drive */
+   SETFEATURES_SPINUP_TIMEOUT  = 3,
 
SETFEATURES_SATA_ENABLE = 0x10, /* Enable use of SATA feature */
SETFEATURES_SATA_DISABLE = 0x90, /* Disable use of SATA feature */



Damien Le Moal, Ph.D.
Sr. Manager, System Software Group, HGST Research,
HGST, a Western Digital company
damien.lem...@hgst.com
(+81) 0466-98-3593 (ext. 513593)
1 kirihara-cho, Fujisawa, 
Kanagawa, 252-0888 Japan
www.hgst.com 
Western Digital Corporation (and its subsidiaries) E-mail Confidentiality 
Notice & Disclaimer:

This e-mail and any files transmitted with it may contain confidential or 
legally privileged information of WDC and/or its affiliates, and are intended 
solely for the use of the individual or entity to which they are addressed. If 
you are not the intended recipient, any disclosure, copying, distribution or 
any action taken or omitted to be taken in reliance on it, is prohibited. If 
you have received this e-mail in error, please notify the sender immediately 
and delete the e-mail in its entirety from your system.
N�r��yb�X��ǧv�^�)޺{.n�+{���"�{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�mzZ+�ݢj"��!�i

[PATCH 5/8] snic: Fix for missing interrupts

2016-03-19 Thread Narsimhulu Musini
- On posting an IO to the firmware, adapter generates an interrupt.
  Due to hardware issues, some times the adapter fails to generate
  the interrupt. This behavior skips updating transmit queue-
  counters, which inturn causes the queue full condition. The fix
  addresses the queue full condition.

- The fix also reserves a slot in transmit queue for hba reset.
  when queue full is observed during IO, there will always be room
  to post hba reset command.

Signed-off-by: Narsimhulu Musini 
Signed-off-by: Sesidhar Baddela 
---
 drivers/scsi/snic/snic_fwint.h |  4 ++-
 drivers/scsi/snic/snic_io.c| 62 ++
 2 files changed, 59 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/snic/snic_fwint.h b/drivers/scsi/snic/snic_fwint.h
index 2cfaf2d..c5f9e19 100644
--- a/drivers/scsi/snic/snic_fwint.h
+++ b/drivers/scsi/snic/snic_fwint.h
@@ -414,7 +414,7 @@ enum snic_ev_type {
 /* Payload 88 bytes = 128 - 24 - 16 */
 #define SNIC_HOST_REQ_PAYLOAD  ((int)(SNIC_HOST_REQ_LEN -  \
sizeof(struct snic_io_hdr) -\
-   (2 * sizeof(u64
+   (2 * sizeof(u64)) - sizeof(ulong)))
 
 /*
  * snic_host_req: host -> firmware request
@@ -448,6 +448,8 @@ struct snic_host_req {
/* hba reset */
struct snic_hba_reset   reset;
} u;
+
+   ulong req_pa;
 }; /* end of snic_host_req structure */
 
 
diff --git a/drivers/scsi/snic/snic_io.c b/drivers/scsi/snic/snic_io.c
index 993db7d..8e69548 100644
--- a/drivers/scsi/snic/snic_io.c
+++ b/drivers/scsi/snic/snic_io.c
@@ -48,7 +48,7 @@ snic_wq_cmpl_frame_send(struct vnic_wq *wq,
SNIC_TRC(snic->shost->host_no, 0, 0,
 ((ulong)(buf->os_buf) - sizeof(struct snic_req_info)), 0, 0,
 0);
-   pci_unmap_single(snic->pdev, buf->dma_addr, buf->len, PCI_DMA_TODEVICE);
+
buf->os_buf = NULL;
 }
 
@@ -137,13 +137,36 @@ snic_select_wq(struct snic *snic)
return 0;
 }
 
+static int
+snic_wqdesc_avail(struct snic *snic, int q_num, int req_type)
+{
+   int nr_wqdesc = snic->config.wq_enet_desc_count;
+
+   if (q_num > 0) {
+   /*
+* Multi Queue case, additional care is required.
+* Per WQ active requests need to be maintained.
+*/
+   SNIC_HOST_INFO(snic->shost, "desc_avail: Multi Queue case.\n");
+   SNIC_BUG_ON(q_num > 0);
+
+   return -1;
+   }
+
+   nr_wqdesc -= atomic64_read(>s_stats.fw.actv_reqs);
+
+   return ((req_type == SNIC_REQ_HBA_RESET) ? nr_wqdesc : nr_wqdesc - 1);
+}
+
 int
 snic_queue_wq_desc(struct snic *snic, void *os_buf, u16 len)
 {
dma_addr_t pa = 0;
unsigned long flags;
struct snic_fw_stats *fwstats = >s_stats.fw;
+   struct snic_host_req *req = (struct snic_host_req *) os_buf;
long act_reqs;
+   long desc_avail = 0;
int q_num = 0;
 
snic_print_desc(__func__, os_buf, len);
@@ -156,11 +179,15 @@ snic_queue_wq_desc(struct snic *snic, void *os_buf, u16 
len)
return -ENOMEM;
}
 
+   req->req_pa = (ulong)pa;
+
q_num = snic_select_wq(snic);
 
spin_lock_irqsave(>wq_lock[q_num], flags);
-   if (!svnic_wq_desc_avail(snic->wq)) {
+   desc_avail = snic_wqdesc_avail(snic, q_num, req->hdr.type);
+   if (desc_avail <= 0) {
pci_unmap_single(snic->pdev, pa, len, PCI_DMA_TODEVICE);
+   req->req_pa = 0;
spin_unlock_irqrestore(>wq_lock[q_num], flags);
atomic64_inc(>s_stats.misc.wq_alloc_fail);
SNIC_DBG("host = %d, WQ is Full\n", snic->shost->host_no);
@@ -169,10 +196,13 @@ snic_queue_wq_desc(struct snic *snic, void *os_buf, u16 
len)
}
 
snic_queue_wq_eth_desc(>wq[q_num], os_buf, pa, len, 0, 0, 1);
+   /*
+* Update stats
+* note: when multi queue enabled, fw actv_reqs should be per queue.
+*/
+   act_reqs = atomic64_inc_return(>actv_reqs);
spin_unlock_irqrestore(>wq_lock[q_num], flags);
 
-   /* Update stats */
-   act_reqs = atomic64_inc_return(>actv_reqs);
if (act_reqs > atomic64_read(>max_actv_reqs))
atomic64_set(>max_actv_reqs, act_reqs);
 
@@ -318,11 +348,31 @@ snic_req_free(struct snic *snic, struct snic_req_info 
*rqi)
  "Req_free:rqi %p:ioreq %p:abt %p:dr %p\n",
  rqi, rqi->req, rqi->abort_req, rqi->dr_req);
 
-   if (rqi->abort_req)
+   if (rqi->abort_req) {
+   if (rqi->abort_req->req_pa)
+   pci_unmap_single(snic->pdev,
+rqi->abort_req->req_pa,
+sizeof(struct snic_host_req),
+PCI_DMA_TODEVICE);
+
 

[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

--- Comment #6 from Orion  ---
sorry I can't have access to the log anymore...

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


I hope this email meets you well in good health condition

2016-03-19 Thread Jones
My name is Jones, from the US. I'm in Syria right now fighting IS. I want to 
get to know you better, if I may be so bold. I consider myself an easy-going 
man, and I am currently looking for a relationship in which I feel loved. 
Please tell me more about yourself, if you don't mind.

Hope to hear from you soon.

Regards,
Jones
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 00/22] ncr5380: Eliminate macros, reduce code duplication, fix bugs etc

2016-03-19 Thread Michael Schmitz
Finn,

tested successfully on Atari Falcon, so:

Tested-by: Michael Schmitz 

Am 14.03.2016 um 17:27 schrieb Finn Thain:
> This patch series has more macro elimination and some tweaks to the
> DMA hooks so that all the wrapper drivers can share the same core
> DMA algorithm. This resolves the major discrepancies between the two
> core drivers, which relate to code conditional on the REAL_DMA and
> PSEUDO_DMA macros.
> 
> After all the wrapper drivers agree on the DMA hook api, the core driver
> fork gets resolved. NCR5380.c is adopted by atari_scsi and sun3_scsi and
> atari_NCR5380.c is then deleted.
> 
> Historically, the 5380 drivers suffered from over-use of conditional
> compilation, which caused the compile-time configuration space to explode,
> leading to core driver code that was practically untestable, unmaintainable
> and difficult to reason about. It also prevented driver modules from
> sharing object code.
> 
> Along with REAL_DMA, REAL_DMA_POLL and PSEUDO_DMA, most of the remaining
> macros are also eradicated, such as CONFIG_SCSI_GENERIC_NCR53C400,
> SUPPORT_TAGS, DONT_USE_INTR, AUTOPROBE_IRQ and BIOSPARAM.
> 
> Also in this patch series, some duplicated documentation is removed and
> the PDMA implementation in mac_scsi finally gets fixed.
> 
> This patch series was tested by exercising the dmx3191d and mac_scsi modules
> on suitable hardware. Help with driver testing on ISA and Atari hardware
> is sought as I don't have any (likewise RiscPC ecards and Sun 3 hardware).
> 
> ---
>  Documentation/scsi/g_NCR5380.txt   |   17 
>  Documentation/scsi/scsi-parameters.txt |   11 
>  drivers/scsi/Kconfig   |   11 
>  drivers/scsi/NCR5380.c |  661 
>  drivers/scsi/NCR5380.h |  145 -
>  drivers/scsi/arm/cumana_1.c|   25 
>  drivers/scsi/arm/oak.c |   22 
>  drivers/scsi/atari_NCR5380.c   | 2676 
> -
>  drivers/scsi/atari_scsi.c  |  142 -
>  drivers/scsi/dmx3191d.c|   10 
>  drivers/scsi/dtc.c |   27 
>  drivers/scsi/dtc.h |7 
>  drivers/scsi/g_NCR5380.c   |  143 -
>  drivers/scsi/g_NCR5380.h   |   26 
>  drivers/scsi/mac_scsi.c|  239 +-
>  drivers/scsi/pas16.c   |   27 
>  drivers/scsi/pas16.h   |5 
>  drivers/scsi/sun3_scsi.c   |   48 
>  drivers/scsi/t128.c|   19 
>  drivers/scsi/t128.h|7 
>  20 files changed, 636 insertions(+), 3632 deletions(-)
> 
> 
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] uas: Limit qdepth at the scsi-host level

2016-03-19 Thread James Bottomley
On Sat, 2016-03-19 at 09:59 +0100, Hans de Goede wrote:
> Commit 64d513ac31bd ("scsi: use host wide tags by default") causes
> the scsi-core to queue more cmnds then we can handle on devices with
> multiple LUNs, limit the qdepth at the scsi-host level instead of
> per slave to fix this.

Help me understand this bug a bit more.  Are you saying that the commit
you identify is causing the block layer to queue more commands than
you've set the per-lun limit to?  In which case we have a serious
problem for more than just UAS.  Or are you saying that UAS always had
a global command limit, but it just didn't get set correctly; however,
it mostly worked until the above commit exposed the problem?


James

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: UFS V11 patch-set

2016-03-19 Thread Arnd Bergmann
On Friday 18 March 2016 12:52:13 Joao Pinto wrote:
> Hi!
> 
> Could you please check the following patch-set in order to evaluate if it is
> ready for v4.6?
> 

I think the code is ok now, but the timing apparently didn't work for 4.6.
I'd suggest you resend as soon as 4.6-rc1 is out so it can get merged into 4.7.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: UFS V11 patch-set

2016-03-19 Thread Joao Pinto
Hi!

On 3/18/2016 2:49 PM, Arnd Bergmann wrote:
> On Friday 18 March 2016 12:52:13 Joao Pinto wrote:
>> Hi!
>>
>> Could you please check the following patch-set in order to evaluate if it is
>> ready for v4.6?
>>
> 
> I think the code is ok now, but the timing apparently didn't work for 4.6.
> I'd suggest you resend as soon as 4.6-rc1 is out so it can get merged into 
> 4.7.

Isn't it possible to be merged into a ufs-dwc branch in the SCSI Git tree that
could be pulled later, like Bjorn did in the PCIe RC?

> 
>   Arnd
> 

Joao

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

--- Comment #2 from nickkra...@sympatico.ca ---
The patch I just attached about this may fix your issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] uas: Limit qdepth at the scsi-host level

2016-03-19 Thread Sergei Shtylyov

Hello.

On 3/19/2016 11:59 AM, Hans de Goede wrote:


Commit 64d513ac31bd ("scsi: use host wide tags by default") causes
the scsi-core to queue more cmnds then we can handle on devices with


   SCSI core? Commands?


multiple LUNs, limit the qdepth at the scsi-host level instead of


   Queue depth?


per slave to fix this.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1315013
Cc: sta...@vger.kernel.org # 4.4.x and 4.5.x
Signed-off-by: Hans de Goede 
---
  drivers/usb/storage/uas.c | 7 ++-
  1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index c90a7e4..b5cb7ab 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c

[...]

@@ -932,6 +931,12 @@ static int uas_probe(struct usb_interface *intf, const 
struct usb_device_id *id)
if (result)
goto set_alt0;

+   /*
+* 1 tag is reserved for untagged commands +
+* 1 tag to avoid of by one errors in some bridge firmwares


   Off by one.

[...]

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v11 5/6] add TC G210 platform driver

2016-03-19 Thread Rob Herring
On Mon, Mar 07, 2016 at 12:09:20PM +, Joao Pinto wrote:
> This patch adds a glue platform driver for the Synopsys G210 Test Chip.
> 
> Signed-off-by: Joao Pinto 
> ---
> Changes v10->v11 (Arnd Bergmann):
> - vops structs are now passed in .data
> Changes v0->v10:
> - This patch only appeared in v10
> 
>  .../devicetree/bindings/ufs/tc-dwc-g210-pltfrm.txt |  26 +
>  drivers/scsi/ufs/Kconfig   |   9 ++
>  drivers/scsi/ufs/Makefile  |   1 +
>  drivers/scsi/ufs/tc-dwc-g210-pltfrm.c  | 113 
> +
>  4 files changed, 149 insertions(+)
>  create mode 100644 
> Documentation/devicetree/bindings/ufs/tc-dwc-g210-pltfrm.txt
>  create mode 100644 drivers/scsi/ufs/tc-dwc-g210-pltfrm.c
> 
> diff --git a/Documentation/devicetree/bindings/ufs/tc-dwc-g210-pltfrm.txt 
> b/Documentation/devicetree/bindings/ufs/tc-dwc-g210-pltfrm.txt
> new file mode 100644
> index 000..6ec9647
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/ufs/tc-dwc-g210-pltfrm.txt
> @@ -0,0 +1,26 @@
> +* Universal Flash Storage (UFS) DesignWare Host Controller
> +
> +DWC_UFS nodes are defined to describe on-chip UFS host controllers and MPHY.
> +Each UFS controller instance should have its own node.
> +
> +Required properties:
> +- compatible : compatible list must contain the PHY type & version:
> + "snps, g210-tc-6.00-20bit"
> + "snps, g210-tc-6.00-40bit"
drop the spaces   ^


> +   complemented with the Controller IP version:
> + "snps, dwc-ufshcd-1.40a"

ditto

> +   complemented with the JEDEC version:
> + "jedec,ufs-1.1"
> + "jedec,ufs-2.0"
> +
> +- reg: 
> +- interrupts : 
> +
> +Example for a setup using a 1.40a DWC Controller with a 6.00 G210 40-bit TC:
> + dwc_ufs@d000 {
> + compatible = "snps, g210-tc-6.00-40bit",
> +  "snps, dwc-ufshcd-1.40a",

ditto

> +  "jedec,ufs-2.0";
> + reg = < 0xd000 0x1 >;
> + interrupts = < 24 >;
> + };
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

--- Comment #8 from nickkra...@sympatico.ca ---
Sorry do you mean the bug log or the kernel bugzilla log?

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv3] scsi: disable automatic target scan

2016-03-19 Thread Laurence Oberman
Hi Hannes,

Please share those dracut patches because I want to test this patch series.
Which kernel is the diff against for the scan patches.

Thanks 

Laurence Oberman
Principal Software Maintenance Engineer
Red Hat Global Support Services

- Original Message -
From: "Hannes Reinecke" 
To: "Bart Van Assche" , "Martin K. Petersen" 

Cc: "Christoph Hellwig" , "James Bottomley" 
, linux-scsi@vger.kernel.org
Sent: Saturday, March 19, 2016 11:18:09 AM
Subject: Re: [PATCHv3] scsi: disable automatic target scan

On 03/18/2016 10:56 PM, Bart Van Assche wrote:
> On 03/17/2016 12:39 AM, Hannes Reinecke wrote:
>> On larger installations it is useful to disable automatic LUN
>> scanning, and only add the required LUNs via udev rules.
>> This can speed up bootup dramatically.
>>
>> This patch introduces a new scan module parameter value 'manual',
>> which works like 'none', but can be overriden by setting the 'rescan'
>> value from scsi_scan_target to 'SCSI_SCAN_MANUAL'.
>> And it updates all relevant callers to set the 'rescan' value
>> to 'SCSI_SCAN_MANUAL' if invoked via the 'scan' option in sysfs.
> 
> Hello Hannes,
> 
> Will setting scsi_scan_type to 'manual' allow a system to boot from a
> SCSI disk? If not, are there alternatives to this approach? Would it be
> a valid alternative to e.g. introduce a new threshold parameter such
> that only LUN numbers below this threshold are scanned during boot?
> 
I have a patch for dracut, which will generate udev rules for all
devices required for mounting the root fs.
Once the system is booted properly I've got another patch for systemd
which switches back to 'normal' scanning (ie by writing 'sync' into
/sys/modules/scsi_mod/parameters/scan) and rescan all scsi hosts.

With that there's no need to have any arbitrary limits; only the
necessary devices are enabled during boot.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke   zSeries & Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv3] scsi: disable automatic target scan

2016-03-19 Thread Hannes Reinecke
On 03/18/2016 10:56 PM, Bart Van Assche wrote:
> On 03/17/2016 12:39 AM, Hannes Reinecke wrote:
>> On larger installations it is useful to disable automatic LUN
>> scanning, and only add the required LUNs via udev rules.
>> This can speed up bootup dramatically.
>>
>> This patch introduces a new scan module parameter value 'manual',
>> which works like 'none', but can be overriden by setting the 'rescan'
>> value from scsi_scan_target to 'SCSI_SCAN_MANUAL'.
>> And it updates all relevant callers to set the 'rescan' value
>> to 'SCSI_SCAN_MANUAL' if invoked via the 'scan' option in sysfs.
> 
> Hello Hannes,
> 
> Will setting scsi_scan_type to 'manual' allow a system to boot from a
> SCSI disk? If not, are there alternatives to this approach? Would it be
> a valid alternative to e.g. introduce a new threshold parameter such
> that only LUN numbers below this threshold are scanned during boot?
> 
I have a patch for dracut, which will generate udev rules for all
devices required for mounting the root fs.
Once the system is booted properly I've got another patch for systemd
which switches back to 'normal' scanning (ie by writing 'sync' into
/sys/modules/scsi_mod/parameters/scan) and rescan all scsi hosts.

With that there's no need to have any arbitrary limits; only the
necessary devices are enabled during boot.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke   zSeries & Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] lpfc: fix misleading indentation

2016-03-19 Thread Martin K. Petersen
> "Arnd" == Arnd Bergmann  writes:

Arnd> gcc-6 complains about the indentation of the
Arnd> lpfc_destroy_vport_work_array() call in lpfc_online(), which
Arnd> clearly doesn't look right:

Applied to 4.6/scsi-fixes.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

--- Comment #13 from nickkra...@sympatico.ca ---
Just type the line:
Tested-by: Your Full Name email address

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] aacraid: add missing curly braces

2016-03-19 Thread Martin K. Petersen
> "Arnd" == Arnd Bergmann  writes:

Raghava,

Please review.

Arnd> gcc-6 warns about obviously wrong indentation for newly added code
Arnd> in aac_slave_configure():

https://patchwork.kernel.org/patch/8579681/

-- 
Martin K. Petersen  Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v10 2/6] added UFS 2.0 capabilities

2016-03-19 Thread Rob Herring
On Fri, Mar 04, 2016 at 05:22:15PM +, Joao Pinto wrote:
> Adding UFS 2.0 support to the UFS core driver.
> 
> Signed-off-by: Joao Pinto 
> ---
> Changes v8->v10:
> - Nothing changed (just to keep up with patch set version).
> Changes v7->v8:
> - Added "jedec, ufs-2.0" to the ufschd-platform compatibility strings
> Changes v0->v7:
> - Nothing changed (just to keep up with patch set version).
> 
>  .../devicetree/bindings/ufs/ufshcd-pltfrm.txt  |  4 +--
>  drivers/scsi/ufs/ufshcd.c  | 29 
> +++---
>  drivers/scsi/ufs/ufshci.h  |  1 +
>  3 files changed, 28 insertions(+), 6 deletions(-)

Acked-by: Rob Herring 
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/8] snic: LUN goes offline due to scsi cmd timeouts

2016-03-19 Thread Narsimhulu Musini
- LUN goes offline, if there are atleast two scsi command timeouts
  Completing the IO with scsi_done() fixes the issue.

Signed-off-by: Narsimhulu Musini 
Signed-off-by: Sesidhar Baddela 
---
 drivers/scsi/snic/snic_scsi.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/drivers/scsi/snic/snic_scsi.c b/drivers/scsi/snic/snic_scsi.c
index e423eaa..5a709eb 100644
--- a/drivers/scsi/snic/snic_scsi.c
+++ b/drivers/scsi/snic/snic_scsi.c
@@ -1465,11 +1465,19 @@ snic_abort_finish(struct snic *snic, struct scsi_cmnd 
*sc)
case SNIC_STAT_IO_SUCCESS:
case SNIC_STAT_IO_NOT_FOUND:
ret = SUCCESS;
+   /*
+* If abort path doesn't call scsi_done(),
+* the # IO timeouts == 2, will cause the LUN offline.
+* Call scsi_done to complete the IO.
+*/
+   sc->result = (DID_ERROR << 16);
+   sc->scsi_done(sc);
break;
 
default:
/* Firmware completed abort with error */
ret = FAILED;
+   rqi = NULL;
break;
}
 
@@ -1842,6 +1850,9 @@ snic_dr_clean_single_req(struct snic *snic,
 
snic_release_req_buf(snic, rqi, sc);
 
+   sc->result = (DID_ERROR << 16);
+   sc->scsi_done(sc);
+
ret = 0;
 
return ret;
@@ -2396,6 +2407,13 @@ snic_cmpl_pending_tmreq(struct snic *snic, struct 
scsi_cmnd *sc)
  "Completing Pending TM Req sc %p, state %s flags 
0x%llx\n",
  sc, snic_io_status_to_str(CMD_STATE(sc)), CMD_FLAGS(sc));
 
+   /*
+* CASE : FW didn't post itmf completion due to PCIe Errors.
+* Marking the abort status as Success to call scsi completion
+* in snic_abort_finish()
+*/
+   CMD_ABTS_STATUS(sc) = SNIC_STAT_IO_SUCCESS;
+
rqi = (struct snic_req_info *) CMD_SP(sc);
if (!rqi)
return;
-- 
1.8.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv3] scsi: disable automatic target scan

2016-03-19 Thread Ewan D. Milne
On Thu, 2016-03-17 at 08:39 +0100, Hannes Reinecke wrote:
> On larger installations it is useful to disable automatic LUN
> scanning, and only add the required LUNs via udev rules.
> This can speed up bootup dramatically.
> 
> This patch introduces a new scan module parameter value 'manual',
> which works like 'none', but can be overriden by setting the 'rescan'
> value from scsi_scan_target to 'SCSI_SCAN_MANUAL'.
> And it updates all relevant callers to set the 'rescan' value
> to 'SCSI_SCAN_MANUAL' if invoked via the 'scan' option in sysfs.
> 
> Signed-off-by: Hannes Reinecke 
> ---
>  drivers/infiniband/ulp/srp/ib_srp.c |  2 +-
>  drivers/message/fusion/mptspi.c |  2 +-
>  drivers/s390/scsi/zfcp_unit.c   |  3 ++-
>  drivers/scsi/scsi_priv.h|  2 +-
>  drivers/scsi/scsi_proc.c|  3 ++-
>  drivers/scsi/scsi_scan.c| 44 
> +
>  drivers/scsi/scsi_sysfs.c   |  3 ++-
>  drivers/scsi/scsi_transport_fc.c|  6 +++--
>  drivers/scsi/scsi_transport_iscsi.c |  5 -
>  drivers/scsi/scsi_transport_sas.c   |  7 +++---
>  drivers/scsi/snic/snic_disc.c   |  2 +-
>  include/scsi/scsi_device.h  |  9 +++-
>  12 files changed, 60 insertions(+), 28 deletions(-)
> 
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c 
> b/drivers/infiniband/ulp/srp/ib_srp.c
> index 03022f6..1f97381 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.c
> +++ b/drivers/infiniband/ulp/srp/ib_srp.c
> @@ -2851,7 +2851,7 @@ static int srp_add_target(struct srp_host *host, struct 
> srp_target_port *target)
>   spin_unlock(>target_lock);
>  
>   scsi_scan_target(>scsi_host->shost_gendev,
> -  0, target->scsi_id, SCAN_WILD_CARD, 0);
> +  0, target->scsi_id, SCAN_WILD_CARD, SCSI_SCAN_INITIAL);
>  
>   if (srp_connected_ch(target) < target->ch_count ||
>   target->qp_in_error) {
> diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
> index 613231c..031e088 100644
> --- a/drivers/message/fusion/mptspi.c
> +++ b/drivers/message/fusion/mptspi.c
> @@ -1150,7 +1150,7 @@ static void mpt_work_wrapper(struct work_struct *work)
>   }
>   shost_printk(KERN_INFO, shost, MYIOC_s_FMT
>   "Integrated RAID detects new device %d\n", ioc->name, disk);
> - scsi_scan_target(>sh->shost_gendev, 1, disk, 0, 1);
> + scsi_scan_target(>sh->shost_gendev, 1, disk, 0, SCSI_SCAN_RESCAN);
>  }
>  
> 
> diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c
> index 157d3d2..08bba7c 100644
> --- a/drivers/s390/scsi/zfcp_unit.c
> +++ b/drivers/s390/scsi/zfcp_unit.c
> @@ -26,7 +26,8 @@ void zfcp_unit_scsi_scan(struct zfcp_unit *unit)
>   lun = scsilun_to_int((struct scsi_lun *) >fcp_lun);
>  
>   if (rport && rport->port_state == FC_PORTSTATE_ONLINE)
> - scsi_scan_target(>dev, 0, rport->scsi_target_id, lun, 1);
> + scsi_scan_target(>dev, 0, rport->scsi_target_id, lun,
> +  SCSI_SCAN_RESCAN);
>  }
>  
>  static void zfcp_unit_scsi_scan_work(struct work_struct *work)
> diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
> index 27b4d0a..57a4b99 100644
> --- a/drivers/scsi/scsi_priv.h
> +++ b/drivers/scsi/scsi_priv.h
> @@ -116,7 +116,7 @@ extern void scsi_exit_procfs(void);
>  extern char scsi_scan_type[];
>  extern int scsi_complete_async_scans(void);
>  extern int scsi_scan_host_selected(struct Scsi_Host *, unsigned int,
> -unsigned int, u64, int);
> +unsigned int, u64, enum scsi_scan_mode);
>  extern void scsi_forget_host(struct Scsi_Host *);
>  extern void scsi_rescan_device(struct device *);
>  
> diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
> index 251598e..7a74b82 100644
> --- a/drivers/scsi/scsi_proc.c
> +++ b/drivers/scsi/scsi_proc.c
> @@ -251,7 +251,8 @@ static int scsi_add_single_device(uint host, uint 
> channel, uint id, uint lun)
>   if (shost->transportt->user_scan)
>   error = shost->transportt->user_scan(shost, channel, id, lun);
>   else
> - error = scsi_scan_host_selected(shost, channel, id, lun, 1);
> + error = scsi_scan_host_selected(shost, channel, id, lun,
> + SCSI_SCAN_MANUAL);
>   scsi_host_put(shost);
>   return error;
>  }
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index 97074c9..6c8ad36 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -96,10 +96,13 @@ MODULE_PARM_DESC(max_luns,
>  #define SCSI_SCAN_TYPE_DEFAULT "sync"
>  #endif
>  
> -char scsi_scan_type[6] = SCSI_SCAN_TYPE_DEFAULT;
> +char scsi_scan_type[7] = SCSI_SCAN_TYPE_DEFAULT;
>  
> -module_param_string(scan, scsi_scan_type, sizeof(scsi_scan_type), S_IRUGO);
> -MODULE_PARM_DESC(scan, "sync, async or none");
> +module_param_string(scan, scsi_scan_type, 

[PATCH 7/8] snic: add scsi host after determining max IOs.

2016-03-19 Thread Narsimhulu Musini
scsi host is added after negotiating the max number of IOs with Firmware.

Signed-off-by: Narsimhulu Musini 
Signed-off-by: Sesidhar Baddela 
---
 drivers/scsi/snic/snic_main.c | 35 +--
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/drivers/scsi/snic/snic_main.c b/drivers/scsi/snic/snic_main.c
index 37ec507..396b32d 100644
--- a/drivers/scsi/snic/snic_main.c
+++ b/drivers/scsi/snic/snic_main.c
@@ -631,19 +631,6 @@ snic_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
goto err_free_tmreq_pool;
}
 
-   /*
-* Initialization done with PCI system, hardware, firmware.
-* Add shost to SCSI
-*/
-   ret = snic_add_host(shost, pdev);
-   if (ret) {
-   SNIC_HOST_ERR(shost,
- "Adding scsi host Failed ... exiting. %d\n",
- ret);
-
-   goto err_notify_unset;
-   }
-
spin_lock_irqsave(_glob->snic_list_lock, flags);
list_add_tail(>list, _glob->snic_list);
spin_unlock_irqrestore(_glob->snic_list_lock, flags);
@@ -676,8 +663,6 @@ snic_probe(struct pci_dev *pdev, const struct pci_device_id 
*ent)
for (i = 0; i < snic->intr_count; i++)
svnic_intr_unmask(>intr[i]);
 
-   snic_set_state(snic, SNIC_ONLINE);
-
/* Get snic params */
ret = snic_get_conf(snic);
if (ret) {
@@ -688,6 +673,21 @@ snic_probe(struct pci_dev *pdev, const struct 
pci_device_id *ent)
goto err_get_conf;
}
 
+   /*
+* Initialization done with PCI system, hardware, firmware.
+* Add shost to SCSI
+*/
+   ret = snic_add_host(shost, pdev);
+   if (ret) {
+   SNIC_HOST_ERR(shost,
+ "Adding scsi host Failed ... exiting. %d\n",
+ ret);
+
+   goto err_get_conf;
+   }
+
+   snic_set_state(snic, SNIC_ONLINE);
+
ret = snic_disc_start(snic);
if (ret) {
SNIC_HOST_ERR(shost, "snic_probe:Discovery Failed w err = %d\n",
@@ -712,6 +712,8 @@ err_req_intr:
svnic_dev_disable(snic->vdev);
 
 err_vdev_enable:
+   svnic_dev_notify_unset(snic->vdev);
+
for (i = 0; i < snic->wq_count; i++) {
int rc = 0;
 
@@ -725,9 +727,6 @@ err_vdev_enable:
}
snic_del_host(snic->shost);
 
-err_notify_unset:
-   svnic_dev_notify_unset(snic->vdev);
-
 err_free_tmreq_pool:
mempool_destroy(snic->req_pool[SNIC_REQ_TM_CACHE]);
 
-- 
1.8.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

--- Comment #18 from nickkra...@sympatico.ca ---
Those patches may fix it but I am pretty sure those patches are in the 3.18.3
kernel release back port. Maybe I am work but let Orion test those patches too
to see if those should be back ported or are already there.

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

--- Comment #5 from nickkra...@sympatico.ca ---
If you are willing to test the patch against main line kernel just o make sure
it's just fine. I also rewrote the patch with a commit log now just add your
tested by below it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/8] snic: target cleanup in driver unload path

2016-03-19 Thread Narsimhulu Musini
Fix deletes the snic targets synchronously prior to deletion of host.

Signed-off-by: Narsimhulu Musini 
Signed-off-by: Sesidhar Baddela 
---
 drivers/scsi/snic/snic_disc.c | 17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/snic/snic_disc.c b/drivers/scsi/snic/snic_disc.c
index 5f63217..c46960c 100644
--- a/drivers/scsi/snic/snic_disc.c
+++ b/drivers/scsi/snic/snic_disc.c
@@ -480,10 +480,21 @@ int
 snic_disc_start(struct snic *snic)
 {
struct snic_disc *disc = >disc;
+   unsigned long flags;
int ret = 0;
 
SNIC_SCSI_DBG(snic->shost, "Discovery Start.\n");
 
+   spin_lock_irqsave(>snic_lock, flags);
+   if (snic->in_remove) {
+   spin_unlock_irqrestore(>snic_lock, flags);
+   SNIC_ERR("snic driver removal in progress ...\n");
+   ret = 0;
+
+   return ret;
+   }
+   spin_unlock_irqrestore(>snic_lock, flags);
+
mutex_lock(>mutex);
if (disc->state == SNIC_DISC_PENDING) {
disc->req_cnt++;
@@ -533,6 +544,8 @@ snic_tgt_del_all(struct snic *snic)
struct list_head *cur, *nxt;
unsigned long flags;
 
+   scsi_flush_work(snic->shost);
+
mutex_lock(>disc.mutex);
spin_lock_irqsave(snic->shost->host_lock, flags);
 
@@ -545,7 +558,7 @@ snic_tgt_del_all(struct snic *snic)
tgt = NULL;
}
spin_unlock_irqrestore(snic->shost->host_lock, flags);
-
-   scsi_flush_work(snic->shost);
mutex_unlock(>disc.mutex);
+
+   flush_workqueue(snic_glob->event_q);
 } /* end of snic_tgt_del_all */
-- 
1.8.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: RE

2016-03-19 Thread Robert
Please confirm receipt of my previous mail..When can i call you 
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RESEND] [PATCH v11 2/6] added UFS 2.0 capabilities

2016-03-19 Thread Rob Herring
On Thu, Mar 17, 2016 at 7:39 AM, Joao Pinto  wrote:
> Adding UFS 2.0 support to the UFS core driver.
>
> Signed-off-by: Joao Pinto 
> Acked-by: Arnd Bergmann 
> Acked-by: Rob Herring 

You don't need to resend just to add acks. The maintainer will do that.

Rob
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv3] scsi: disable automatic target scan

2016-03-19 Thread Hannes Reinecke
On larger installations it is useful to disable automatic LUN
scanning, and only add the required LUNs via udev rules.
This can speed up bootup dramatically.

This patch introduces a new scan module parameter value 'manual',
which works like 'none', but can be overriden by setting the 'rescan'
value from scsi_scan_target to 'SCSI_SCAN_MANUAL'.
And it updates all relevant callers to set the 'rescan' value
to 'SCSI_SCAN_MANUAL' if invoked via the 'scan' option in sysfs.

Signed-off-by: Hannes Reinecke 
---
 drivers/infiniband/ulp/srp/ib_srp.c |  2 +-
 drivers/message/fusion/mptspi.c |  2 +-
 drivers/s390/scsi/zfcp_unit.c   |  3 ++-
 drivers/scsi/scsi_priv.h|  2 +-
 drivers/scsi/scsi_proc.c|  3 ++-
 drivers/scsi/scsi_scan.c| 44 +
 drivers/scsi/scsi_sysfs.c   |  3 ++-
 drivers/scsi/scsi_transport_fc.c|  6 +++--
 drivers/scsi/scsi_transport_iscsi.c |  5 -
 drivers/scsi/scsi_transport_sas.c   |  7 +++---
 drivers/scsi/snic/snic_disc.c   |  2 +-
 include/scsi/scsi_device.h  |  9 +++-
 12 files changed, 60 insertions(+), 28 deletions(-)

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c 
b/drivers/infiniband/ulp/srp/ib_srp.c
index 03022f6..1f97381 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -2851,7 +2851,7 @@ static int srp_add_target(struct srp_host *host, struct 
srp_target_port *target)
spin_unlock(>target_lock);
 
scsi_scan_target(>scsi_host->shost_gendev,
-0, target->scsi_id, SCAN_WILD_CARD, 0);
+0, target->scsi_id, SCAN_WILD_CARD, SCSI_SCAN_INITIAL);
 
if (srp_connected_ch(target) < target->ch_count ||
target->qp_in_error) {
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 613231c..031e088 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -1150,7 +1150,7 @@ static void mpt_work_wrapper(struct work_struct *work)
}
shost_printk(KERN_INFO, shost, MYIOC_s_FMT
"Integrated RAID detects new device %d\n", ioc->name, disk);
-   scsi_scan_target(>sh->shost_gendev, 1, disk, 0, 1);
+   scsi_scan_target(>sh->shost_gendev, 1, disk, 0, SCSI_SCAN_RESCAN);
 }
 
 
diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c
index 157d3d2..08bba7c 100644
--- a/drivers/s390/scsi/zfcp_unit.c
+++ b/drivers/s390/scsi/zfcp_unit.c
@@ -26,7 +26,8 @@ void zfcp_unit_scsi_scan(struct zfcp_unit *unit)
lun = scsilun_to_int((struct scsi_lun *) >fcp_lun);
 
if (rport && rport->port_state == FC_PORTSTATE_ONLINE)
-   scsi_scan_target(>dev, 0, rport->scsi_target_id, lun, 1);
+   scsi_scan_target(>dev, 0, rport->scsi_target_id, lun,
+SCSI_SCAN_RESCAN);
 }
 
 static void zfcp_unit_scsi_scan_work(struct work_struct *work)
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index 27b4d0a..57a4b99 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -116,7 +116,7 @@ extern void scsi_exit_procfs(void);
 extern char scsi_scan_type[];
 extern int scsi_complete_async_scans(void);
 extern int scsi_scan_host_selected(struct Scsi_Host *, unsigned int,
-  unsigned int, u64, int);
+  unsigned int, u64, enum scsi_scan_mode);
 extern void scsi_forget_host(struct Scsi_Host *);
 extern void scsi_rescan_device(struct device *);
 
diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c
index 251598e..7a74b82 100644
--- a/drivers/scsi/scsi_proc.c
+++ b/drivers/scsi/scsi_proc.c
@@ -251,7 +251,8 @@ static int scsi_add_single_device(uint host, uint channel, 
uint id, uint lun)
if (shost->transportt->user_scan)
error = shost->transportt->user_scan(shost, channel, id, lun);
else
-   error = scsi_scan_host_selected(shost, channel, id, lun, 1);
+   error = scsi_scan_host_selected(shost, channel, id, lun,
+   SCSI_SCAN_MANUAL);
scsi_host_put(shost);
return error;
 }
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 97074c9..6c8ad36 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -96,10 +96,13 @@ MODULE_PARM_DESC(max_luns,
 #define SCSI_SCAN_TYPE_DEFAULT "sync"
 #endif
 
-char scsi_scan_type[6] = SCSI_SCAN_TYPE_DEFAULT;
+char scsi_scan_type[7] = SCSI_SCAN_TYPE_DEFAULT;
 
-module_param_string(scan, scsi_scan_type, sizeof(scsi_scan_type), S_IRUGO);
-MODULE_PARM_DESC(scan, "sync, async or none");
+module_param_string(scan, scsi_scan_type, sizeof(scsi_scan_type),
+   S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(scan, "sync, async, manual, or none. "
+"Setting to 'manual' disables automatic scanning, but allows "
+"for manual device 

[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

--- Comment #10 from nickkra...@sympatico.ca ---
That's OK :). If you can however add tested by on my patch I would really
appreciate it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning

2016-03-19 Thread Himanshu Madhani


On 3/16/16, 5:59 AM, "Arnd Bergmann"  wrote:

>On Tuesday 15 March 2016 14:49:14 James Bottomley wrote:
>> On Tue, 2016-03-15 at 22:40 +0100, Arnd Bergmann wrote:
>> > 
>> > This slightly rearranges the code to move the second if() block
>> > into the first one, to avoid the warning while retaining the
>> > behavior of the code.
>> 
>> I thought our usual policy was to ask someone to fix the compiler when
>> it emitted a spurious warning.
>
>No, the rule is that we shouldn't blindly add initializations to
>the variables when the compiler should have figured it out.
>
>In this case, I wouldn't expect the compiler to ever see through
>the unlikely() macro, and I'm not adding a potentially counterproductive
>initialization, so I see no reason not to apply the patch.

I would like to keep unlikely() macro in the code. This patch looks good.

Acked-By: Himanshu Madhani 

>
>Making it easier for the compiler to figure out what is going
>on should also lead to slightly better object code. If you think
>my patch makes it less readable, an alternative would be to remove
>the 'unlikely', which also gets rid of the warning.
>
>   Arnd

<>

[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

nickkra...@sympatico.ca changed:

   What|Removed |Added

 CC||nickkra...@sympatico.ca

--- Comment #1 from nickkra...@sympatico.ca ---
Created attachment 209671
  --> https://bugzilla.kernel.org/attachment.cgi?id=209671=edit
Test Fix

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] scsi: storvsc: Support manual scan of FC hosts on Hyper-V

2016-03-19 Thread James Bottomley
On Wed, 2016-03-16 at 23:15 +, KY Srinivasan wrote:
> 
> > -Original Message-
> > From: James Bottomley [mailto:james.bottom...@hansenpartnership.com
> > ]
> > Sent: Wednesday, March 16, 2016 4:08 PM
> > To: Martin K. Petersen ; KY Srinivasan
> > 
> > Cc: Christoph Hellwig ; 
> > gre...@linuxfoundation.org;
> > linux-ker...@vger.kernel.org; de...@linuxdriverproject.org;
> > oher...@suse.com; jbottom...@parallels.com; 
> > linux-scsi@vger.kernel.org;
> > a...@canonical.com; vkuzn...@redhat.com; jasow...@redhat.com;
> > h...@suse.de
> > Subject: Re: [PATCH 1/1] scsi: storvsc: Support manual scan of FC
> > hosts on
> > Hyper-V
> > 
> > On Wed, 2016-03-16 at 18:34 -0400, Martin K. Petersen wrote:
> > > > > > > > "KY" == KY Srinivasan  writes:
> > > 
> > > KY> How would I get the sysfs files under fc_host if I don't use
> > > the
> > > FC
> > > KY> transport.  The customer scripts expect these sysfs files.
> > > 
> > > Right, but I was interested in finding out why they need those
> > > files. And whether an alternative to the FC transport would be a
> > > better solution.
> > 
> > If it's just the wwn file (or a set of other values), we might be
> > able
> > to separate that bit out of the FC transport class so you can use
> > it
> > independently ... do you have a full list of the files being used?
> 
> Wwn files are what we can support on Hyper-V and that is what I want 
> to support (to address customer requirements).

There is no wwn file.  These are all the possible attributes they could
use; which one(s) do you want:

/*
 * Setup SCSI Host Attributes.
 */
SETUP_HOST_ATTRIBUTE_RD(node_name);
SETUP_HOST_ATTRIBUTE_RD(port_name);
SETUP_HOST_ATTRIBUTE_RD(permanent_port_name);
SETUP_HOST_ATTRIBUTE_RD(supported_classes);
SETUP_HOST_ATTRIBUTE_RD(supported_fc4s);
SETUP_HOST_ATTRIBUTE_RD(supported_speeds);
SETUP_HOST_ATTRIBUTE_RD(maxframe_size);
if (ft->vport_create) {
SETUP_HOST_ATTRIBUTE_RD_NS(max_npiv_vports);
SETUP_HOST_ATTRIBUTE_RD_NS(npiv_vports_inuse);
}
SETUP_HOST_ATTRIBUTE_RD(serial_number);
SETUP_HOST_ATTRIBUTE_RD(manufacturer);
SETUP_HOST_ATTRIBUTE_RD(model);
SETUP_HOST_ATTRIBUTE_RD(model_description);
SETUP_HOST_ATTRIBUTE_RD(hardware_version);
SETUP_HOST_ATTRIBUTE_RD(driver_version);
SETUP_HOST_ATTRIBUTE_RD(firmware_version);
SETUP_HOST_ATTRIBUTE_RD(optionrom_version);

SETUP_HOST_ATTRIBUTE_RD(port_id);
SETUP_HOST_ATTRIBUTE_RD(port_type);
SETUP_HOST_ATTRIBUTE_RD(port_state);
SETUP_HOST_ATTRIBUTE_RD(active_fc4s);
SETUP_HOST_ATTRIBUTE_RD(speed);
SETUP_HOST_ATTRIBUTE_RD(fabric_name);
SETUP_HOST_ATTRIBUTE_RD(symbolic_name);
SETUP_HOST_ATTRIBUTE_RW(system_hostname);

/* Transport-managed attributes */
SETUP_PRIVATE_HOST_ATTRIBUTE_RW(dev_loss_tmo);
SETUP_PRIVATE_HOST_ATTRIBUTE_RW(tgtid_bind_type);
if (ft->issue_fc_host_lip)
SETUP_PRIVATE_HOST_ATTRIBUTE_RW(issue_lip);
if (ft->vport_create)
SETUP_PRIVATE_HOST_ATTRIBUTE_RW(vport_create);
if (ft->vport_delete)
SETUP_PRIVATE_HOST_ATTRIBUTE_RW(vport_delete);
/*
 * Setup Remote Port Attributes.
 */
count=0;
SETUP_RPORT_ATTRIBUTE_RD(maxframe_size);
SETUP_RPORT_ATTRIBUTE_RD(supported_classes);
SETUP_RPORT_ATTRIBUTE_RW(dev_loss_tmo);
SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(node_name);
SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(port_name);
SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(port_id);
SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(roles);
SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(port_state);
SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(scsi_target_id);
SETUP_PRIVATE_RPORT_ATTRIBUTE_RW(fast_io_fail_tmo);

/*
 * Setup Virtual Port Attributes.
 */
SETUP_PRIVATE_VPORT_ATTRIBUTE_RD(vport_state);
SETUP_PRIVATE_VPORT_ATTRIBUTE_RD(vport_last_state);
SETUP_PRIVATE_VPORT_ATTRIBUTE_RD(node_name);
SETUP_PRIVATE_VPORT_ATTRIBUTE_RD(port_name);
SETUP_PRIVATE_VPORT_ATTRIBUTE_RD(roles);
SETUP_PRIVATE_VPORT_ATTRIBUTE_RD(vport_type);
SETUP_VPORT_ATTRIBUTE_RW(symbolic_name);
SETUP_VPORT_ATTRIBUTE_WR(vport_delete);
SETUP_VPORT_ATTRIBUTE_WR(vport_disable);

I'm assuming it's host and rport port_id?

James


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 1/1] scsi: storvsc: Support manual scan of FC hosts on Hyper-V

2016-03-19 Thread KY Srinivasan


> -Original Message-
> From: James Bottomley [mailto:james.bottom...@hansenpartnership.com]
> Sent: Wednesday, March 16, 2016 4:41 PM
> To: KY Srinivasan ; Martin K. Petersen
> 
> Cc: Christoph Hellwig ; gre...@linuxfoundation.org;
> linux-ker...@vger.kernel.org; de...@linuxdriverproject.org;
> oher...@suse.com; jbottom...@parallels.com; linux-scsi@vger.kernel.org;
> a...@canonical.com; vkuzn...@redhat.com; jasow...@redhat.com;
> h...@suse.de
> Subject: Re: [PATCH 1/1] scsi: storvsc: Support manual scan of FC hosts on
> Hyper-V
> 
> On Wed, 2016-03-16 at 23:15 +, KY Srinivasan wrote:
> >
> > > -Original Message-
> > > From: James Bottomley
> [mailto:james.bottom...@hansenpartnership.com
> > > ]
> > > Sent: Wednesday, March 16, 2016 4:08 PM
> > > To: Martin K. Petersen ; KY Srinivasan
> > > 
> > > Cc: Christoph Hellwig ;
> > > gre...@linuxfoundation.org;
> > > linux-ker...@vger.kernel.org; de...@linuxdriverproject.org;
> > > oher...@suse.com; jbottom...@parallels.com;
> > > linux-scsi@vger.kernel.org;
> > > a...@canonical.com; vkuzn...@redhat.com; jasow...@redhat.com;
> > > h...@suse.de
> > > Subject: Re: [PATCH 1/1] scsi: storvsc: Support manual scan of FC
> > > hosts on
> > > Hyper-V
> > >
> > > On Wed, 2016-03-16 at 18:34 -0400, Martin K. Petersen wrote:
> > > > > > > > > "KY" == KY Srinivasan  writes:
> > > >
> > > > KY> How would I get the sysfs files under fc_host if I don't use
> > > > the
> > > > FC
> > > > KY> transport.  The customer scripts expect these sysfs files.
> > > >
> > > > Right, but I was interested in finding out why they need those
> > > > files. And whether an alternative to the FC transport would be a
> > > > better solution.
> > >
> > > If it's just the wwn file (or a set of other values), we might be
> > > able
> > > to separate that bit out of the FC transport class so you can use
> > > it
> > > independently ... do you have a full list of the files being used?
> >
> > Wwn files are what we can support on Hyper-V and that is what I want
> > to support (to address customer requirements).
> 
> There is no wwn file.  These are all the possible attributes they could
> use; which one(s) do you want:
> 
>   /*
>* Setup SCSI Host Attributes.
>*/
>   SETUP_HOST_ATTRIBUTE_RD(node_name);
>   SETUP_HOST_ATTRIBUTE_RD(port_name);
>   SETUP_HOST_ATTRIBUTE_RD(permanent_port_name);
>   SETUP_HOST_ATTRIBUTE_RD(supported_classes);
>   SETUP_HOST_ATTRIBUTE_RD(supported_fc4s);
>   SETUP_HOST_ATTRIBUTE_RD(supported_speeds);
>   SETUP_HOST_ATTRIBUTE_RD(maxframe_size);
>   if (ft->vport_create) {
>   SETUP_HOST_ATTRIBUTE_RD_NS(max_npiv_vports);
>   SETUP_HOST_ATTRIBUTE_RD_NS(npiv_vports_inuse);
>   }
>   SETUP_HOST_ATTRIBUTE_RD(serial_number);
>   SETUP_HOST_ATTRIBUTE_RD(manufacturer);
>   SETUP_HOST_ATTRIBUTE_RD(model);
>   SETUP_HOST_ATTRIBUTE_RD(model_description);
>   SETUP_HOST_ATTRIBUTE_RD(hardware_version);
>   SETUP_HOST_ATTRIBUTE_RD(driver_version);
>   SETUP_HOST_ATTRIBUTE_RD(firmware_version);
>   SETUP_HOST_ATTRIBUTE_RD(optionrom_version);
> 
>   SETUP_HOST_ATTRIBUTE_RD(port_id);
>   SETUP_HOST_ATTRIBUTE_RD(port_type);
>   SETUP_HOST_ATTRIBUTE_RD(port_state);
>   SETUP_HOST_ATTRIBUTE_RD(active_fc4s);
>   SETUP_HOST_ATTRIBUTE_RD(speed);
>   SETUP_HOST_ATTRIBUTE_RD(fabric_name);
>   SETUP_HOST_ATTRIBUTE_RD(symbolic_name);
>   SETUP_HOST_ATTRIBUTE_RW(system_hostname);
> 
>   /* Transport-managed attributes */
>   SETUP_PRIVATE_HOST_ATTRIBUTE_RW(dev_loss_tmo);
>   SETUP_PRIVATE_HOST_ATTRIBUTE_RW(tgtid_bind_type);
>   if (ft->issue_fc_host_lip)
>   SETUP_PRIVATE_HOST_ATTRIBUTE_RW(issue_lip);
>   if (ft->vport_create)
>   SETUP_PRIVATE_HOST_ATTRIBUTE_RW(vport_create);
>   if (ft->vport_delete)
>   SETUP_PRIVATE_HOST_ATTRIBUTE_RW(vport_delete);
>   /*
>* Setup Remote Port Attributes.
>*/
>   count=0;
>   SETUP_RPORT_ATTRIBUTE_RD(maxframe_size);
>   SETUP_RPORT_ATTRIBUTE_RD(supported_classes);
>   SETUP_RPORT_ATTRIBUTE_RW(dev_loss_tmo);
>   SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(node_name);
>   SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(port_name);
>   SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(port_id);
>   SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(roles);
>   SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(port_state);
>   SETUP_PRIVATE_RPORT_ATTRIBUTE_RD(scsi_target_id);
>   SETUP_PRIVATE_RPORT_ATTRIBUTE_RW(fast_io_fail_tmo);
> 
>   /*
>* Setup Virtual Port Attributes.
>*/
>   SETUP_PRIVATE_VPORT_ATTRIBUTE_RD(vport_state);
>   SETUP_PRIVATE_VPORT_ATTRIBUTE_RD(vport_last_state);
>   SETUP_PRIVATE_VPORT_ATTRIBUTE_RD(node_name);
>   

Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning

2016-03-19 Thread Martin K. Petersen
> "Arnd" == Arnd Bergmann  writes:

Arnd> The qlt_check_reserve_free_req() function produces an incorrect
Arnd> warning when CONFIG_PROFILE_ANNOTATED_BRANCHES is set:

Applied to 4.6/scsi-fixes.

-- 
Martin K. Petersen  Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] uas: Limit qdepth at the scsi-host level

2016-03-19 Thread Hans de Goede
Commit 64d513ac31bd ("scsi: use host wide tags by default") causes
the scsi-core to queue more cmnds then we can handle on devices with
multiple LUNs, limit the qdepth at the scsi-host level instead of
per slave to fix this.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1315013
Cc: sta...@vger.kernel.org # 4.4.x and 4.5.x
Signed-off-by: Hans de Goede 
---
 drivers/usb/storage/uas.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index c90a7e4..b5cb7ab 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -800,7 +800,6 @@ static int uas_slave_configure(struct scsi_device *sdev)
if (devinfo->flags & US_FL_BROKEN_FUA)
sdev->broken_fua = 1;
 
-   scsi_change_queue_depth(sdev, devinfo->qdepth - 2);
return 0;
 }
 
@@ -932,6 +931,12 @@ static int uas_probe(struct usb_interface *intf, const 
struct usb_device_id *id)
if (result)
goto set_alt0;
 
+   /*
+* 1 tag is reserved for untagged commands +
+* 1 tag to avoid of by one errors in some bridge firmwares
+*/
+   shost->can_queue = devinfo->qdepth - 2;
+
usb_set_intfdata(intf, shost);
result = scsi_add_host(shost, >dev);
if (result)
-- 
2.7.3

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning

2016-03-19 Thread Tomas Henzl
On 15.3.2016 22:40, Arnd Bergmann wrote:
> The qlt_check_reserve_free_req() function produces an incorrect warning
> when CONFIG_PROFILE_ANNOTATED_BRANCHES is set:
>
> drivers/scsi/qla2xxx/qla_target.c: In function 'qlt_check_reserve_free_req':
> drivers/scsi/qla2xxx/qla_target.c:1887:3: error: 'cnt_in' may be used 
> uninitialized in this function [-Werror=maybe-uninitialized]
>ql_dbg(ql_dbg_io, vha, 0x305a,
>^~
>"qla_target(%d): There is no room in the request ring: 
> vha->req->ring_index=%d, vha->req->cnt=%d, req_cnt=%d Req-out=%d Req-in=%d 
> Req-Length=%d\n",
>
> ~~~
>vha->vp_idx, vha->req->ring_index,
>~~
>vha->req->cnt, req_cnt, cnt, cnt_in, vha->req->length);
>~~
> drivers/scsi/qla2xxx/qla_target.c:1887:3: error: 'cnt' may be used 
> uninitialized in this function [-Werror=maybe-uninitialized]
>
> The problem is that gcc fails to track the state of the condition across
> an annotated branch.
>
> This slightly rearranges the code to move the second if() block
> into the first one, to avoid the warning while retaining the
> behavior of the code.

When the first 'if' is true the vha->req->ring_index gets a new value 
assigned - so it could be possible that the second 'if' wont be true any more.
The code should not be merged into that single 'if', or am I missing something?

tomash

>
> Signed-off-by: Arnd Bergmann 
> ---
>  drivers/scsi/qla2xxx/qla_target.c | 16 +---
>  1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/scsi/qla2xxx/qla_target.c 
> b/drivers/scsi/qla2xxx/qla_target.c
> index 985231900aca..8a44d1541eb4 100644
> --- a/drivers/scsi/qla2xxx/qla_target.c
> +++ b/drivers/scsi/qla2xxx/qla_target.c
> @@ -1881,15 +1881,17 @@ static int qlt_check_reserve_free_req(struct 
> scsi_qla_host *vha,
>   else
>   vha->req->cnt = vha->req->length -
>   (vha->req->ring_index - cnt);
> - }
>  
> - if (unlikely(vha->req->cnt < (req_cnt + 2))) {
> - ql_dbg(ql_dbg_io, vha, 0x305a,
> - "qla_target(%d): There is no room in the request ring: 
> vha->req->ring_index=%d, vha->req->cnt=%d, req_cnt=%d Req-out=%d Req-in=%d 
> Req-Length=%d\n",
> - vha->vp_idx, vha->req->ring_index,
> - vha->req->cnt, req_cnt, cnt, cnt_in, vha->req->length);
> - return -EAGAIN;
> + if (unlikely(vha->req->cnt < (req_cnt + 2))) {
> + ql_dbg(ql_dbg_io, vha, 0x305a,
> + "qla_target(%d): There is no room in the request 
> ring: vha->req->ring_index=%d, vha->req->cnt=%d, req_cnt=%d Req-out=%d 
> Req-in=%d Req-Length=%d\n",
> + vha->vp_idx, vha->req->ring_index,
> + vha->req->cnt, req_cnt, cnt, cnt_in,
> + vha->req->length);
> + return -EAGAIN;
> + }
>   }
> +
>   vha->req->cnt -= req_cnt;
>  
>   return 0;

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v1 1/3] Fix to cleanup aborted IO to avoid device being offlined by mid-layer

2016-03-19 Thread Satish Kharat
If an I/O times out and an abort issued by host, if the abort is
successful we need to set scsi status as DID_ABORT. Or else the
mid-layer error handler which looks for this error code, will
offline the device. Also if the original I/O is not found in fnic
firmware, we will consider the abort as successful.
The start_time assignment is moved because of the new goto.
Fnic driver version changed from 1.6.0.17a to 1.6.0.19,
version 1.6.0.18 has been skipped

Signed-off-by: Satish Kharat 
Signed-off-by: Sesidhar Baddela 
Reviewed-by: Ewan D. Milne 
---
 * v1
 - Moved CMD_ABTS_STATUS assignment to else when not FCPIO_SUCCESS

 drivers/scsi/fnic/fnic.h  |  2 +-
 drivers/scsi/fnic/fnic_scsi.c | 35 +--
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/fnic/fnic.h b/drivers/scsi/fnic/fnic.h
index ce129e5..52a53f8 100644
--- a/drivers/scsi/fnic/fnic.h
+++ b/drivers/scsi/fnic/fnic.h
@@ -39,7 +39,7 @@
 
 #define DRV_NAME   "fnic"
 #define DRV_DESCRIPTION"Cisco FCoE HBA Driver"
-#define DRV_VERSION"1.6.0.17a"
+#define DRV_VERSION"1.6.0.19"
 #define PFXDRV_NAME ": "
 #define DFX DRV_NAME "%d: "
 
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index 266b909..b732fa3 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -1092,6 +1092,11 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic 
*fnic,
atomic64_inc(
_stats->terminate_fw_timeouts);
break;
+   case FCPIO_ITMF_REJECTED:
+   FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host,
+   "abort reject recd. id %d\n",
+   (int)(id & FNIC_TAG_MASK));
+   break;
case FCPIO_IO_NOT_FOUND:
if (CMD_FLAGS(sc) & FNIC_IO_ABTS_ISSUED)
atomic64_inc(_stats->abort_io_not_found);
@@ -1112,9 +1117,15 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic 
*fnic,
spin_unlock_irqrestore(io_lock, flags);
return;
}
-   CMD_ABTS_STATUS(sc) = hdr_status;
+
CMD_FLAGS(sc) |= FNIC_IO_ABT_TERM_DONE;
 
+   /* If the status is IO not found consider it as success */
+   if (hdr_status == FCPIO_IO_NOT_FOUND)
+   CMD_ABTS_STATUS(sc) = FCPIO_SUCCESS;
+   else
+   CMD_ABTS_STATUS(sc) = hdr_status;
+
atomic64_dec(_stats->io_stats.active_ios);
if (atomic64_read(>io_cmpl_skip))
atomic64_dec(>io_cmpl_skip);
@@ -1927,21 +1938,33 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
 
CMD_STATE(sc) = FNIC_IOREQ_ABTS_COMPLETE;
 
+   start_time = io_req->start_time;
/*
 * firmware completed the abort, check the status,
-* free the io_req irrespective of failure or success
+* free the io_req if successful. If abort fails,
+* Device reset will clean the I/O.
 */
-   if (CMD_ABTS_STATUS(sc) != FCPIO_SUCCESS)
+   if (CMD_ABTS_STATUS(sc) == FCPIO_SUCCESS) {
+   CMD_SP(sc) = NULL;
+   }
+   else
+   {
ret = FAILED;
-
-   CMD_SP(sc) = NULL;
+   spin_unlock_irqrestore(io_lock, flags);
+   goto fnic_abort_cmd_end;
+   }
 
spin_unlock_irqrestore(io_lock, flags);
 
-   start_time = io_req->start_time;
fnic_release_ioreq_buf(fnic, io_req, sc);
mempool_free(io_req, fnic->io_req_pool);
 
+   if (sc->scsi_done) {
+   /* Call SCSI completion function to complete the IO */
+   sc->result = (DID_ABORT << 16);
+   sc->scsi_done(sc);
+   }
+
 fnic_abort_cmd_end:
FNIC_TRACE(fnic_abort_cmd, sc->device->host->host_no,
  sc->request->tag, sc,
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

--- Comment #15 from nickkra...@sympatico.ca ---
And if you do get around to it try testing on mainline. Personally I wrote the
patch on mail line so if it applies clearly to your kernel it possibly works
fine on main line but just doubt check if you can.

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] scsi_common: do not clobber fixed sense information

2016-03-19 Thread Lee Duncan
On 03/18/2016 01:01 AM, Hannes Reinecke wrote:
> For fixed sense the information field is 32 bits, to we need
> to truncate the information field to avoid clobbering the
> sense code.
> 
> Signed-off-by: Hannes Reinecke 
> ---
>  drivers/scsi/scsi_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c
> index c126966..3459009 100644
> --- a/drivers/scsi/scsi_common.c
> +++ b/drivers/scsi/scsi_common.c
> @@ -279,7 +279,7 @@ int scsi_set_sense_information(u8 *buf, int buf_len, u64 
> info)
>   put_unaligned_be64(info, [4]);
>   } else if ((buf[0] & 0x7f) == 0x70) {
>   buf[0] |= 0x80;
> - put_unaligned_be64(info, [3]);
> + put_unaligned_be32((u32)info, [3]);
>   }
>  
>   return 0;
> 

Reviewed-by: Lee Duncan 

-- 
Lee
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] mpt3sas: Don't overreach ioc->reply_post[] during initialization

2016-03-19 Thread Calvin Owens
In _base_make_ioc_operational(), we walk ioc->reply_queue_list and pull
a pointer out of successive elements of ioc->reply_post[] for each entry
in that list if RDPQ is enabled.

Since the code pulls the pointer for the next iteration at the bottom of
the loop, it triggers the a KASAN dump on the final iteration:

BUG: KASAN: slab-out-of-bounds in _base_make_ioc_operational+0x47b7/0x47e0 
[mpt3sas] at addr 880754816ab0
Read of size 8 by task modprobe/305

Call Trace:
 [] dump_stack+0x4d/0x6c
 [] print_trailer+0xf9/0x150
 [] object_err+0x34/0x40
 [] kasan_report_error+0x221/0x530
 [] __asan_report_load8_noabort+0x43/0x50
 [] _base_make_ioc_operational+0x47b7/0x47e0 [mpt3sas]
 [] mpt3sas_base_attach+0x1991/0x2120 [mpt3sas]
 [] _scsih_probe+0xeb3/0x16b0 [mpt3sas]
 [] local_pci_probe+0xc7/0x170
 [] pci_device_probe+0x20f/0x290
 [] really_probe+0x17d/0x600
 [] __driver_attach+0x153/0x190
 [] bus_for_each_dev+0x11c/0x1a0
 [] driver_attach+0x3d/0x50
 [] bus_add_driver+0x44a/0x5f0
 [] driver_register+0x18c/0x3b0
 [] __pci_register_driver+0x156/0x200
 [] _mpt3sas_init+0x135/0x1000 [mpt3sas]
 [] do_one_initcall+0x113/0x2b0
 [] do_init_module+0x1d0/0x4d8
 [] load_module+0x6729/0x8dc0
 [] SYSC_init_module+0x183/0x1a0
 [] SyS_init_module+0xe/0x10
 [] entry_SYSCALL_64_fastpath+0x12/0x6a

Fix this by pulling the value at the beginning of the loop.

Signed-off-by: Calvin Owens 
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 33 -
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c 
b/drivers/scsi/mpt3sas/mpt3sas_base.c
index e4db5fb..8c44b9c 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -5030,7 +5030,7 @@ _base_make_ioc_ready(struct MPT3SAS_ADAPTER *ioc, int 
sleep_flag,
 static int
 _base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc, int sleep_flag)
 {
-   int r, i;
+   int r, i, index;
unsigned long   flags;
u32 reply_address;
u16 smid;
@@ -5039,8 +5039,7 @@ _base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc, 
int sleep_flag)
struct _event_ack_list *delayed_event_ack, *delayed_event_ack_next;
u8 hide_flag;
struct adapter_reply_queue *reply_q;
-   long reply_post_free;
-   u32 reply_post_free_sz, index = 0;
+   Mpi2ReplyDescriptorsUnion_t *reply_post_free_contig;
 
dinitprintk(ioc, pr_info(MPT3SAS_FMT "%s\n", ioc->name,
__func__));
@@ -5124,27 +5123,27 @@ _base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc, 
int sleep_flag)
_base_assign_reply_queues(ioc);
 
/* initialize Reply Post Free Queue */
-   reply_post_free_sz = ioc->reply_post_queue_depth *
-   sizeof(Mpi2DefaultReplyDescriptor_t);
-   reply_post_free = (long)ioc->reply_post[index].reply_post_free;
+   index = 0;
+   reply_post_free_contig = ioc->reply_post[0].reply_post_free;
list_for_each_entry(reply_q, >reply_queue_list, list) {
+   /*
+* If RDPQ is enabled, switch to the next allocation.
+* Otherwise advance within the contiguous region.
+*/
+   if (ioc->rdpq_array_enable) {
+   reply_q->reply_post_free =
+   ioc->reply_post[index++].reply_post_free;
+   } else {
+   reply_q->reply_post_free = reply_post_free_contig;
+   reply_post_free_contig += ioc->reply_post_queue_depth;
+   }
+
reply_q->reply_post_host_index = 0;
-   reply_q->reply_post_free = (Mpi2ReplyDescriptorsUnion_t *)
-   reply_post_free;
for (i = 0; i < ioc->reply_post_queue_depth; i++)
reply_q->reply_post_free[i].Words =
cpu_to_le64(ULLONG_MAX);
if (!_base_is_controller_msix_enabled(ioc))
goto skip_init_reply_post_free_queue;
-   /*
-* If RDPQ is enabled, switch to the next allocation.
-* Otherwise advance within the contiguous region.
-*/
-   if (ioc->rdpq_array_enable)
-   reply_post_free = (long)
-   ioc->reply_post[++index].reply_post_free;
-   else
-   reply_post_free += reply_post_free_sz;
}
  skip_init_reply_post_free_queue:
 
-- 
2.8.0.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning

2016-03-19 Thread Arnd Bergmann
On Tuesday 15 March 2016 14:49:14 James Bottomley wrote:
> On Tue, 2016-03-15 at 22:40 +0100, Arnd Bergmann wrote:
> > 
> > This slightly rearranges the code to move the second if() block
> > into the first one, to avoid the warning while retaining the
> > behavior of the code.
> 
> I thought our usual policy was to ask someone to fix the compiler when
> it emitted a spurious warning.

No, the rule is that we shouldn't blindly add initializations to
the variables when the compiler should have figured it out.

In this case, I wouldn't expect the compiler to ever see through
the unlikely() macro, and I'm not adding a potentially counterproductive
initialization, so I see no reason not to apply the patch.

Making it easier for the compiler to figure out what is going
on should also lead to slightly better object code. If you think
my patch makes it less readable, an alternative would be to remove
the 'unlikely', which also gets rid of the warning.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 1/1] scsi: storvsc: Support manual scan of FC hosts on Hyper-V

2016-03-19 Thread KY Srinivasan


> -Original Message-
> From: James Bottomley [mailto:james.bottom...@hansenpartnership.com]
> Sent: Wednesday, March 16, 2016 4:08 PM
> To: Martin K. Petersen ; KY Srinivasan
> 
> Cc: Christoph Hellwig ; gre...@linuxfoundation.org;
> linux-ker...@vger.kernel.org; de...@linuxdriverproject.org;
> oher...@suse.com; jbottom...@parallels.com; linux-scsi@vger.kernel.org;
> a...@canonical.com; vkuzn...@redhat.com; jasow...@redhat.com;
> h...@suse.de
> Subject: Re: [PATCH 1/1] scsi: storvsc: Support manual scan of FC hosts on
> Hyper-V
> 
> On Wed, 2016-03-16 at 18:34 -0400, Martin K. Petersen wrote:
> > > > > > > "KY" == KY Srinivasan  writes:
> >
> > KY> How would I get the sysfs files under fc_host if I don't use the
> > FC
> > KY> transport.  The customer scripts expect these sysfs files.
> >
> > Right, but I was interested in finding out why they need those
> > files. And whether an alternative to the FC transport would be a
> > better solution.
> 
> If it's just the wwn file (or a set of other values), we might be able
> to separate that bit out of the FC transport class so you can use it
> independently ... do you have a full list of the files being used?

Wwn files are what we can support on Hyper-V and that is what I want to support
(to address customer requirements).

Regards,

K. Y 



[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

--- Comment #12 from Orion  ---
how can I mark tested on your patch?

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v1 3/3] Using rport->dd_data to check rport online instead of rport_lookup.

2016-03-19 Thread Satish Kharat
When issuing I/O we check if rport is online through libfc
rport_lookup() function which needs to be protected by mutex lock
that cannot acquired in I/O context. The change is to use midlayer
remote port’s dd_data which is preserved until its devloss timeout
and no protection is required.
The the scsi_cmnd error code is expected to be in the left 16 bits
of the result field. Changed to correct this.
Fnic driver version changed from 1.6.0.20 to 1.6.0.21

Signed-off-by: Satish Kharat 
Signed-off-by: Sesidhar Baddela 
---
 * v1
 - DID_NO_CONNECT left shifted 16 bits before assigning to sc->result
---
 drivers/scsi/fnic/fnic.h  |  2 +-
 drivers/scsi/fnic/fnic_scsi.c | 20 +++-
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/fnic/fnic.h b/drivers/scsi/fnic/fnic.h
index 1023eae..9ddc920 100644
--- a/drivers/scsi/fnic/fnic.h
+++ b/drivers/scsi/fnic/fnic.h
@@ -39,7 +39,7 @@
 
 #define DRV_NAME   "fnic"
 #define DRV_DESCRIPTION"Cisco FCoE HBA Driver"
-#define DRV_VERSION"1.6.0.20"
+#define DRV_VERSION"1.6.0.21"
 #define PFXDRV_NAME ": "
 #define DFX DRV_NAME "%d: "
 
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index 026b93d..0e874a5 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -439,7 +439,6 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void 
(*done)(struct scsi_
int sg_count = 0;
unsigned long flags = 0;
unsigned long ptr;
-   struct fc_rport_priv *rdata;
spinlock_t *io_lock = NULL;
int io_lock_acquired = 0;
 
@@ -455,14 +454,17 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, 
void (*done)(struct scsi_
return 0;
}
 
-   rdata = lp->tt.rport_lookup(lp, rport->port_id);
-   if (!rdata || (rdata->rp_state == RPORT_ST_DELETE)) {
-   FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
-   "returning IO as rport is removed\n");
-   atomic64_inc(_stats->misc_stats.rport_not_ready);
-   sc->result = DID_NO_CONNECT;
-   done(sc);
-   return 0;
+   if (rport) {
+   struct fc_rport_libfc_priv *rp = rport->dd_data;
+
+   if (!rp || rp->rp_state != RPORT_ST_READY) {
+   FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
+   "returning DID_NO_CONNECT for IO as rport is 
removed\n");
+   atomic64_inc(_stats->misc_stats.rport_not_ready);
+   sc->result = DID_NO_CONNECT<<16;
+   done(sc);
+   return 0;
+   }
}
 
if (lp->state != LPORT_ST_READY || !(lp->link_up))
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/5] Fix to cleanup aborted IO to avoid device being offlined by mid-layer

2016-03-19 Thread Satish Kharat (satishkh)
Thanks for the review comments. I incorporated the comments, below is the 
updated patch: 


If an I/O times out and an abort issued by host, if the abort is
successful we need to set scsi status as DID_ABORT. Or else the
mid-layer error handler which looks for this error code, will
offline the device. Also if the original I/O is not found in fnic
firmware, we will consider the abort as successful.
The start_time assignment is moved because of the new goto.
Fnic driver version changed from 1.6.0.17a to 1.6.0.19,
version 1.6.0.18 has been skipped

Signed-off-by: Satish Kharat 
---
 drivers/scsi/fnic/fnic.h  |  2 +-
 drivers/scsi/fnic/fnic_scsi.c | 35 +--
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/fnic/fnic.h b/drivers/scsi/fnic/fnic.h
index ce129e5..52a53f8 100644
--- a/drivers/scsi/fnic/fnic.h
+++ b/drivers/scsi/fnic/fnic.h
@@ -39,7 +39,7 @@
 
 #define DRV_NAME   "fnic"
 #define DRV_DESCRIPTION"Cisco FCoE HBA Driver"
-#define DRV_VERSION"1.6.0.17a"
+#define DRV_VERSION"1.6.0.19"
 #define PFXDRV_NAME ": "
 #define DFX DRV_NAME "%d: "
 
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index 266b909..b732fa3 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -1092,6 +1092,11 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic 
*fnic,
atomic64_inc(
_stats->terminate_fw_timeouts);
break;
+   case FCPIO_ITMF_REJECTED:
+   FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host,
+   "abort reject recd. id %d\n",
+   (int)(id & FNIC_TAG_MASK));
+   break;
case FCPIO_IO_NOT_FOUND:
if (CMD_FLAGS(sc) & FNIC_IO_ABTS_ISSUED)
atomic64_inc(_stats->abort_io_not_found);
@@ -1112,9 +1117,15 @@ static void fnic_fcpio_itmf_cmpl_handler(struct fnic 
*fnic,
spin_unlock_irqrestore(io_lock, flags);
return;
}
-   CMD_ABTS_STATUS(sc) = hdr_status;
+
CMD_FLAGS(sc) |= FNIC_IO_ABT_TERM_DONE;
 
+   /* If the status is IO not found consider it as success */
+   if (hdr_status == FCPIO_IO_NOT_FOUND)
+   CMD_ABTS_STATUS(sc) = FCPIO_SUCCESS;
+   else
+   CMD_ABTS_STATUS(sc) = hdr_status;
+
atomic64_dec(_stats->io_stats.active_ios);
if (atomic64_read(>io_cmpl_skip))
atomic64_dec(>io_cmpl_skip);
@@ -1927,21 +1938,33 @@ int fnic_abort_cmd(struct scsi_cmnd *sc)
 
CMD_STATE(sc) = FNIC_IOREQ_ABTS_COMPLETE;
 
+   start_time = io_req->start_time;
/*
 * firmware completed the abort, check the status,
-* free the io_req irrespective of failure or success
+* free the io_req if successful. If abort fails,
+* Device reset will clean the I/O.
 */
-   if (CMD_ABTS_STATUS(sc) != FCPIO_SUCCESS)
+   if (CMD_ABTS_STATUS(sc) == FCPIO_SUCCESS) {
+   CMD_SP(sc) = NULL;
+   }
+   else
+   {
ret = FAILED;
-
-   CMD_SP(sc) = NULL;
+   spin_unlock_irqrestore(io_lock, flags);
+   goto fnic_abort_cmd_end;
+   }
 
spin_unlock_irqrestore(io_lock, flags);
 
-   start_time = io_req->start_time;
fnic_release_ioreq_buf(fnic, io_req, sc);
mempool_free(io_req, fnic->io_req_pool);
 
+   if (sc->scsi_done) {
+   /* Call SCSI completion function to complete the IO */
+   sc->result = (DID_ABORT << 16);
+   sc->scsi_done(sc);
+   }
+
 fnic_abort_cmd_end:
FNIC_TRACE(fnic_abort_cmd, sc->device->host->host_no,
  sc->request->tag, sc,
-- 
2.4.3


From: Ewan Milne 
Sent: Monday, March 14, 2016 12:59 PM
To: Satish Kharat (satishkh)
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/5] Fix to cleanup aborted IO to avoid device being 
offlined by mid-layer

On Mon, 2016-03-14 at 11:14 -0700, Satish Kharat wrote:
> If an I/O times out and an abort issued by host, if the abort is
> successful we need to set scsi status as DID_ABORT. Or else the
> mid-layer error handler which looks for this error code, will
> offline the device. Also if the original I/O is not found in fnic
> firmware, we will consider the abort as successful.
> Fnic driver version changed from 1.6.0.17a to 1.6.0.19,
> version 1.6.0.18 has been skipped
>
> Signed-off-by: Satish Kharat 
> ---
>  drivers/scsi/fnic/fnic.h  |  2 +-
>  drivers/scsi/fnic/fnic_scsi.c | 32 +++-

[Bug 91711] 3w-9xxx: DMA-API: device driver tries to free DMA memory it has not allocated

2016-03-19 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=91711

--- Comment #3 from Orion  ---
Seems to work now thank you very much.
do you think your patch will be included on 4.x kernels?

-- 
You are receiving this mail because:
You are the assignee for the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] scsi: fc: use get/put_unaligned64 for wwn access

2016-03-19 Thread Arnd Bergmann
A bug in the gcc-6.0 prerelease version caused at least one
driver (lpfc) to have excessive stack usage when dealing with
wwn data, on the ARM architecture.

lpfc_scsi.c: In function 'lpfc_find_next_oas_lun':
lpfc_scsi.c:117:1: warning: the frame size of 1152 bytes is larger than 1024 
bytes [-Wframe-larger-than=]

I have reported this as a gcc regression in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70232

However, using a better implementation of wwn_to_u64() not only
helps with the particular gcc problem but also leads to better
object code for any version or architecture.

The kernel already provides get_unaligned_be64() and
put_unaligned_be64() helper functions that provide an
optimized implementation with the desired semantics.

The lpfc_find_next_oas_lun() function in the example that
grew from 1146 bytes to 5144 bytes when moving from gcc-5.3
to gcc-6.0 is now 804 bytes, as the optimized
get_unaligned_be64() load can be done in three instructions.
The stack usage is now down to 28 bytes from 128 bytes with
gcc-5.3 before.

Signed-off-by: Arnd Bergmann 
---
 include/scsi/scsi_transport_fc.h | 15 +++
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 784bc2c0929f..bf66ea6bed2b 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -28,6 +28,7 @@
 #define SCSI_TRANSPORT_FC_H
 
 #include 
+#include 
 #include 
 #include 
 
@@ -797,22 +798,12 @@ fc_remote_port_chkready(struct fc_rport *rport)
 
 static inline u64 wwn_to_u64(u8 *wwn)
 {
-   return (u64)wwn[0] << 56 | (u64)wwn[1] << 48 |
-   (u64)wwn[2] << 40 | (u64)wwn[3] << 32 |
-   (u64)wwn[4] << 24 | (u64)wwn[5] << 16 |
-   (u64)wwn[6] <<  8 | (u64)wwn[7];
+   return get_unaligned_be64(wwn);
 }
 
 static inline void u64_to_wwn(u64 inm, u8 *wwn)
 {
-   wwn[0] = (inm >> 56) & 0xff;
-   wwn[1] = (inm >> 48) & 0xff;
-   wwn[2] = (inm >> 40) & 0xff;
-   wwn[3] = (inm >> 32) & 0xff;
-   wwn[4] = (inm >> 24) & 0xff;
-   wwn[5] = (inm >> 16) & 0xff;
-   wwn[6] = (inm >> 8) & 0xff;
-   wwn[7] = inm & 0xff;
+   put_unaligned_be64(inm, wwn);
 }
 
 /**
-- 
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] scsi_common: do not clobber fixed sense information

2016-03-19 Thread Hannes Reinecke
For fixed sense the information field is 32 bits, to we need
to truncate the information field to avoid clobbering the
sense code.

Signed-off-by: Hannes Reinecke 
---
 drivers/scsi/scsi_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_common.c b/drivers/scsi/scsi_common.c
index c126966..3459009 100644
--- a/drivers/scsi/scsi_common.c
+++ b/drivers/scsi/scsi_common.c
@@ -279,7 +279,7 @@ int scsi_set_sense_information(u8 *buf, int buf_len, u64 
info)
put_unaligned_be64(info, [4]);
} else if ((buf[0] & 0x7f) == 0x70) {
buf[0] |= 0x80;
-   put_unaligned_be64(info, [3]);
+   put_unaligned_be32((u32)info, [3]);
}
 
return 0;
-- 
1.8.5.6

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/1] scsi: storvsc: Support manual scan of FC hosts on Hyper-V

2016-03-19 Thread James Bottomley
On Wed, 2016-03-16 at 18:34 -0400, Martin K. Petersen wrote:
> > > > > > "KY" == KY Srinivasan  writes:
> 
> KY> How would I get the sysfs files under fc_host if I don't use the
> FC
> KY> transport.  The customer scripts expect these sysfs files.
> 
> Right, but I was interested in finding out why they need those
> files. And whether an alternative to the FC transport would be a 
> better solution.

If it's just the wwn file (or a set of other values), we might be able
to separate that bit out of the FC transport class so you can use it
independently ... do you have a full list of the files being used?

Thanks,

James

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html