Re: [PATCH v6 1/2] ahci_xgene: Removing NCQ support from the APM X-Gene SoC AHCI SATA Host Controller driver.

2014-08-16 Thread Tejun Heo
On Fri, Aug 08, 2014 at 09:44:25PM +0530, Suman Tripathi wrote:
 This patch removes the NCQ support from the APM X-Gene SoC AHCI
 Host Controller driver as it doesn't support it.
 
 Signed-off-by: Loc Ho l...@apm.com
 Signed-off-by: Suman Tripathi stripa...@apm.com

Applied to libata/for-3.17-fixes w/ stable cc'd.

Thanks.

-- 
tejun
--
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 v3] scsi: ufs-msm: add UFS controller support for Qualcomm MSM chips

2014-08-16 Thread Dan Aloni
On Thu, Aug 14, 2014 at 05:22:18PM +0300, Yaniv Gardi wrote:
 diff --git a/drivers/scsi/ufs/ufs-msm.h b/drivers/scsi/ufs/ufs-msm.h
 new file mode 100644
 index 000..6e93f1e
 --- /dev/null
 +++ b/drivers/scsi/ufs/ufs-msm.h
 @@ -0,0 +1,158 @@
[...]
 +};
 +
 +static LIST_HEAD(phy_list);
 +

Just noticed this via a quick glance - Seems that this variable is not
referenced by any of the compilation units, what's the purpose of it?
And as a static global in a shared private, each of the including
compilation units gets a copy, which I am not sure was intended
anyway.

-- 
Dan Aloni
--
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: fix various kernel-doc problems in scsi_error.c

2014-08-16 Thread Randy Dunlap
From: Randy Dunlap rdun...@infradead.org

Convert spaces to tabs in kernel-doc notation.
Correct duplicated (copy-paste) kernel-doc comments that are incorrect.
Fix kernel-doc warning:

Warning(..//drivers/scsi/scsi_error.c:1647): No description found for parameter 
'shost'

Signed-off-by: Randy Dunlap rdun...@infradead.org
---
 drivers/scsi/scsi_error.c |   23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

Index: lnx-317-rc1/drivers/scsi/scsi_error.c
===
--- lnx-317-rc1.orig/drivers/scsi/scsi_error.c
+++ lnx-317-rc1/drivers/scsi/scsi_error.c
@@ -1238,8 +1238,8 @@ retry_tur:
 /**
  * scsi_eh_test_devices - check if devices are responding from error recovery.
  * @cmd_list:  scsi commands in error recovery.
- * @work_q: queue for commands which still need more error recovery
- * @done_q: queue for commands which are finished
+ * @work_q:queue for commands which still need more error recovery
+ * @done_q:queue for commands which are finished
  * @try_stu:boolean on if a STU command should be tried in addition to TUR.
  *
  * Decription:
@@ -1373,7 +1373,7 @@ static int scsi_eh_try_stu(struct scsi_c
  /**
  * scsi_eh_stu - send START_UNIT if needed
  * @shost: scsi host being recovered.
- * @work_q: list_head for pending commands.
+ * @work_q:list_head for pending commands.
  * @done_q:list_head for processed commands.
  *
  * Notes:
@@ -1436,7 +1436,7 @@ static int scsi_eh_stu(struct Scsi_Host
 /**
  * scsi_eh_bus_device_reset - send bdr if needed
  * @shost: scsi host being recovered.
- * @work_q: list_head for pending commands.
+ * @work_q:list_head for pending commands.
  * @done_q:list_head for processed commands.
  *
  * Notes:
@@ -1502,7 +1502,7 @@ static int scsi_eh_bus_device_reset(stru
 /**
  * scsi_eh_target_reset - send target reset if needed
  * @shost: scsi host being recovered.
- * @work_q: list_head for pending commands.
+ * @work_q:list_head for pending commands.
  * @done_q:list_head for processed commands.
  *
  * Notes:
@@ -1567,7 +1567,7 @@ static int scsi_eh_target_reset(struct S
 /**
  * scsi_eh_bus_reset - send a bus reset
  * @shost: scsi host being recovered.
- * @work_q: list_head for pending commands.
+ * @work_q:list_head for pending commands.
  * @done_q:list_head for processed commands.
  */
 static int scsi_eh_bus_reset(struct Scsi_Host *shost,
@@ -1638,8 +1638,9 @@ static int scsi_eh_bus_reset(struct Scsi
 
 /**
  * scsi_eh_host_reset - send a host reset
- * @work_q:list_head for processed commands.
- * @done_q:list_head for processed commands.
+ * @shost: host to be reset.
+ * @work_q:list_head for pending commands.
+ * @done_q:list_head for processed commands.
  */
 static int scsi_eh_host_reset(struct Scsi_Host *shost,
  struct list_head *work_q,
@@ -1677,8 +1678,8 @@ static int scsi_eh_host_reset(struct Scs
 
 /**
  * scsi_eh_offline_sdevs - offline scsi devices that fail to recover
- * @work_q:list_head for processed commands.
- * @done_q:list_head for processed commands.
+ * @work_q:list_head for pending commands.
+ * @done_q:list_head for processed commands.
  */
 static void scsi_eh_offline_sdevs(struct list_head *work_q,
  struct list_head *done_q)
@@ -2044,7 +2045,7 @@ static void scsi_restart_operations(stru
 /**
  * scsi_eh_ready_devs - check device ready state and recover if not.
  * @shost: host to be recovered.
- * @work_q: list_head for pending commands.
+ * @work_q:list_head for pending commands.
  * @done_q:list_head for processed commands.
  */
 void scsi_eh_ready_devs(struct Scsi_Host *shost,
--
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] fusion: fix excess parameter kernel-doc warning

2014-08-16 Thread Randy Dunlap
From: Randy Dunlap rdun...@infradead.org

Fix kernel-doc excess parameter warning:

Warning(..//drivers/message/fusion/mptbase.c:1411): Excess function parameter 
'prod_name' description in 'mpt_get_product_name'

Signed-off-by: Randy Dunlap rdun...@infradead.org
Cc: dl-mptfusionli...@lsi.com
Cc: mpt-fusionlinux@avagotech.com
---
 drivers/message/fusion/mptbase.c |1 -
 1 file changed, 1 deletion(-)

Index: lnx-317-rc1/drivers/message/fusion/mptbase.c
===
--- lnx-317-rc1.orig/drivers/message/fusion/mptbase.c
+++ lnx-317-rc1/drivers/message/fusion/mptbase.c
@@ -1400,7 +1400,6 @@ mpt_verify_adapter(int iocid, MPT_ADAPTE
  * @vendor: pci vendor id
  * @device: pci device id
  * @revision: pci revision id
- * @prod_name: string returned
  *
  * Returns product string displayed when driver loads,
  * in /proc/mpt/summary and /sysfs/class/scsi_host/hostX/version_product
--
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/2] Drivers: scsi: storvsc: Force discovery of LUNs that may have been removed.

2014-08-16 Thread K. Y. Srinivasan
The host asks the guest to scan when a LUN is removed or added.
The only way a guest can identify the removed LUN is when an I/O is
attempted on a removed LUN - the SRB status code indicates that the LUN
is invalid. We currently handle this SRB status and remove the device.

Rather than waiting for an I/O to remove the device, force the discovery of
LUNs that may have been removed prior to discovering LUNs that may have
been added.

Signed-off-by: K. Y. Srinivasan k...@microsoft.com
---
 drivers/scsi/storvsc_drv.c |   26 ++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 02d1db6..fb38ca9 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -430,10 +430,36 @@ static void storvsc_host_scan(struct work_struct *work)
 {
struct storvsc_scan_work *wrk;
struct Scsi_Host *host;
+   struct scsi_device *sdev;
+   unsigned long flags;
 
wrk = container_of(work, struct storvsc_scan_work, work);
host = wrk-host;
 
+   /*
+* Before scanning the host, first check to see if any of the
+* currrently known devices have been hot removed. We issue a
+* unit ready command against all currently known devices.
+* This I/O will result in an error for devices that have been
+* removed. As part of handling the I/O error, we remove the device.
+*
+* When a LUN is added or removed, the host sends us a signal to
+* scan the host. Thus we are forced to discover the LUNs that
+* may have been removed this way.
+*/
+   mutex_lock(host-scan_mutex);
+   spin_lock_irqsave(host-host_lock, flags);
+   list_for_each_entry(sdev, host-__devices, siblings) {
+   spin_unlock_irqrestore(host-host_lock, flags);
+   scsi_test_unit_ready(sdev, 1, 1, NULL);
+   spin_lock_irqsave(host-host_lock, flags);
+   continue;
+   }
+   spin_unlock_irqrestore(host-host_lock, flags);
+   mutex_unlock(host-scan_mutex);
+   /*
+* Now scan the host to discover LUNs that may have been added.
+*/
scsi_scan_host(host);
 
kfree(wrk);
-- 
1.7.4.1

--
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 0/2] Drivers: scsi: storvsc: Fix issues with hot-add/remove of LUNs

2014-08-16 Thread K. Y. Srinivasan
This patch-set addresses issues with LUN hot-add and remove. When the host
notifies the guest that a scan is needed, scan the host. Also, prior to
discovering new devices that may have been added, ensure we handle the
LUN remove case first.

K. Y. Srinivasan (2):
  Drivers: scsi: storvsc: In responce to a scan event, scan the host
  Drivers: scsi: storvsc: Force discovery of LUNs that may have been
removed.

 drivers/scsi/storvsc_drv.c |   43 ---
 1 files changed, 32 insertions(+), 11 deletions(-)

-- 
1.7.4.1

--
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 1/2] Drivers: scsi: storvsc: In responce to a scan event, scan the host

2014-08-16 Thread K. Y. Srinivasan
The virtual HBA that storvsc implements can support multiple channels and
targets. So, scan the host when the host notifies that a scan is needed.

Signed-off-by: K. Y. Srinivasan k...@microsoft.com
---
 drivers/scsi/storvsc_drv.c |   19 +++
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 15ba695..02d1db6 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -426,21 +426,16 @@ done:
kfree(wrk);
 }
 
-static void storvsc_bus_scan(struct work_struct *work)
+static void storvsc_host_scan(struct work_struct *work)
 {
struct storvsc_scan_work *wrk;
-   int id, order_id;
+   struct Scsi_Host *host;
 
wrk = container_of(work, struct storvsc_scan_work, work);
-   for (id = 0; id  wrk-host-max_id; ++id) {
-   if (wrk-host-reverse_ordering)
-   order_id = wrk-host-max_id - id - 1;
-   else
-   order_id = id;
-
-   scsi_scan_target(wrk-host-shost_gendev, 0,
-   order_id, SCAN_WILD_CARD, 1);
-   }
+   host = wrk-host;
+
+   scsi_scan_host(host);
+
kfree(wrk);
 }
 
@@ -1209,7 +1204,7 @@ static void storvsc_on_receive(struct hv_device *device,
if (!work)
return;
 
-   INIT_WORK(work-work, storvsc_bus_scan);
+   INIT_WORK(work-work, storvsc_host_scan);
work-host = stor_device-host;
schedule_work(work-work);
break;
-- 
1.7.4.1

--
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 V4 3/4] Introduce XEN scsiback module

2014-08-16 Thread Nicholas A. Bellinger
On Wed, 2014-08-13 at 09:02 +0200, Juergen Gross wrote:
 On 08/12/2014 11:13 PM, Nicholas A. Bellinger wrote:

SNIP

 
  +
  +static int scsiback_port_link(struct se_portal_group *se_tpg,
  + struct se_lun *lun)
  +{
  +  struct scsiback_tpg *tpg = container_of(se_tpg,
  +  struct scsiback_tpg, se_tpg);
  +
  +  mutex_lock(scsiback_mutex);
  +
  +  mutex_lock(tpg-tv_tpg_mutex);
  +  tpg-tv_tpg_port_count++;
  +  mutex_unlock(tpg-tv_tpg_mutex);
  +
  +  mutex_unlock(scsiback_mutex);
  +
  +  return 0;
  +}
  +
 
  AFAICT, no need to hold scsiback_mutex while incrementing
  tpg-tv_tpg_port_count.
 
 So there is a guarantee that port_link and port_unlink are never
 called in parallel?
 

Correct.  configfs_symlink() only calls create_link() once
type-ct_item_ops-allow_link() - target_fabric_port_link() -
TFO-fabric_post_link() has successfully completed, effectively
preventing configfs_unlink() + subsequent TFO-fabric_pre_unlink()
execution until after configfs_symlink() completes.

--nab

--
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: [Xen-devel] [PATCH V4 3/4] Introduce XEN scsiback module

2014-08-16 Thread Nicholas A. Bellinger
On Thu, 2014-08-14 at 06:34 +0200, Juergen Gross wrote:
 On 08/13/2014 09:02 AM, Juergen Gross wrote:
  On 08/12/2014 11:13 PM, Nicholas A. Bellinger wrote:
  Hi Juergen  Co,
 
  Finally had a chance to review this code.  Comments are inline below..
 
  +static struct se_node_acl *
  +scsiback_alloc_fabric_acl(struct se_portal_group *se_tpg)
  +{
  +struct scsiback_nacl *nacl;
  +
  +nacl = kzalloc(sizeof(struct scsiback_nacl), GFP_KERNEL);
  +if (!nacl) {
  +pr_err(Unable to allocate struct scsiback_nacl\n);
  +return NULL;
  +}
  +
  +return nacl-se_node_acl;
  +}
  +
  +static void
  +scsiback_release_fabric_acl(struct se_portal_group *se_tpg,
  + struct se_node_acl *se_nacl)
  +{
  +struct scsiback_nacl *nacl = container_of(se_nacl,
  +struct scsiback_nacl, se_node_acl);
  +kfree(nacl);
  +}
  +
  +static u32 scsiback_tpg_get_inst_index(struct se_portal_group *se_tpg)
  +{
  +return 1;
  +}
  +
  +static struct se_node_acl *
  +scsiback_make_nodeacl(struct se_portal_group *se_tpg,
  +   struct config_group *group,
  +   const char *name)
  +{
  +struct se_node_acl *se_nacl, *se_nacl_new;
  +struct scsiback_nacl *nacl;
  +u64 wwpn = 0;
  +u32 nexus_depth;
  +
  +se_nacl_new = scsiback_alloc_fabric_acl(se_tpg);
  +if (!se_nacl_new)
  +return ERR_PTR(-ENOMEM);
  +
  +nexus_depth = 1;
  +/*
  + * se_nacl_new may be released by core_tpg_add_initiator_node_acl()
  + * when converting a NodeACL from demo mode - explict
  + */
  +se_nacl = core_tpg_add_initiator_node_acl(se_tpg, se_nacl_new,
  +name, nexus_depth);
  +if (IS_ERR(se_nacl)) {
  +scsiback_release_fabric_acl(se_tpg, se_nacl_new);
  +return se_nacl;
  +}
  +/*
  + * Locate our struct scsiback_nacl and set the FC Nport WWPN
  + */
  +nacl = container_of(se_nacl, struct scsiback_nacl, se_node_acl);
  +nacl-iport_wwpn = wwpn;
  +
  +return se_nacl;
  +}
  +
  +static void scsiback_drop_nodeacl(struct se_node_acl *se_acl)
  +{
  +struct scsiback_nacl *nacl = container_of(se_acl,
  +struct scsiback_nacl, se_node_acl);
  +core_tpg_del_initiator_node_acl(se_acl-se_tpg, se_acl, 1);
  +kfree(nacl);
  +}
  +
 
  As mentioned above, the NodeACL use is unnecessary for this driver so
  you can safely drop scsiback_make_node_acl() +
  scsiback_alloc_fabric_acl() + scsiback_drop_nodeacl() +
  scsiback_release_fabric_acl().
 
  Deleted.
 
 target_fabric_tf_ops_check() complains about missing
 tpg_alloc_fabric_acl and tpg_release_fabric_acl.
 

Sorry, yes, you still need a struct scsiback_nacl that contains struct
se_node_acl, along with these two callbacks for allocating + releasing
the associated scsiback_nacl memory.

This is required because TFO-tpg_alloc_fabric_acl() is called to
allocate struct scsiback_nacl at core_tpg_add_initiator_node_acl() time
when TFO-check_demo_mode() == 1 has been set.

Normal fabric NodeACLs (eg: ones not generated in the kernel by
demo-mode) hang off configfs, so the TFO-tpg_*_fabric_acl() call is
driven from TFO-fabric_make_nodeacl(), which is the part that can
safely be dropped here.

--nab

--
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: [Xen-devel] [PATCH V4 3/4] Introduce XEN scsiback module

2014-08-16 Thread Nicholas A. Bellinger
On Thu, 2014-08-14 at 12:14 +0200, Juergen Gross wrote:
 On 08/14/2014 10:53 AM, Juergen Gross wrote:
  Nicholas,
 
  just one more question (see below):
 
  On 08/12/2014 11:13 PM, Nicholas A. Bellinger wrote:
  Hi Juergen  Co,
 
  Finally had a chance to review this code.  Comments are inline below..
 
  On Fri, 2014-08-08 at 09:49 +0200, jgr...@suse.com wrote:
 
  ...
 
  +if (IS_ERR(tv_nexus-tvn_se_sess)) {
  +mutex_unlock(tpg-tv_tpg_mutex);
  +kfree(tv_nexus);
  +return -ENOMEM;
  +}
  +se_sess = tv_nexus-tvn_se_sess;
  +/*
  + * Since we are running in 'demo mode' this call with generate a
  + * struct se_node_acl for the scsiback struct se_portal_group with
  + * the SCSI Initiator port name of the passed configfs group
  'name'.
  + */
  +tv_nexus-tvn_se_sess-se_node_acl =
  core_tpg_check_initiator_node_acl(
  +se_tpg, (unsigned char *)name);
  +if (!tv_nexus-tvn_se_sess-se_node_acl) {
  +mutex_unlock(tpg-tv_tpg_mutex);
  +pr_debug(core_tpg_check_initiator_node_acl() failed for %s\n,
  + name);
  +goto out;
  +}
 
  Can I drop the call to core_tpg_check_initiator_node_acl() as well?
  Keeping it will result in failing to setup the nexus (which is to be
  expected IMHO).
 
 Obviously I can't. transport_lookup_cmd_lun() calls right at start
 spin_lock_irqsave(se_sess-se_node_acl-device_list_lock, flags);
 resulting in a page fault...
 
 I guess the hint to just throw away all the node_acl related stuff has
 to be adjusted somehow...
 
 So: what is needed, what can be removed?
 

The scsiback_make_nodeacl() + scsiback_drop_nodeacl() configfs callbacks
can be safely dropped, along with scisback_ncal-iport_[wwpn,name].

--nab

--
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