[Bug 111341] Firmware loader

2016-02-25 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=111341

--- Comment #5 from walter59  ---
hello,

bug is still alive on most boards --- changes has has no resolved problems.

regards

-- 
You are receiving this mail because:
You are watching the assignee of 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: [RFC 00/34] Chelsio iSCSI target offload driver

2016-02-25 Thread Nicholas A. Bellinger
Hi Varun & Co,

Apologies for the delayed follow up here.

On Sun, 2016-02-14 at 23:00 +0530, Varun Prakash wrote:
> This RFC series is for Chelsio iSCSI target offload
> driver(cxgbit.ko).
> 
> cxgbit.ko registers with iSCSI target transport
> and offloads multiple CPU intensive tasks to
> Chelsio T5 adapters.
> 
> Chelsio T5 adapter series has following offload
> features for iSCSI -
> -TCP/IP offload.
> -iSCSI PDU recovery by reassembling TCP segments.
> -Header and Data Digest offload.
> -iSCSI segmentation offload(ISO).
> -Direct Data Placement(DDP).
> 
> Please review this series.
> 

After spending time over the last weeks to understand how cxgbit.ko
offloads work in patches #27-34, I think overall the new driver is in
very good shape.

Wrt to the patches to existing iscsi-target code in patches #13-26, I
need more time over the next days to consider the changes and/or better
alternatives, along with Sagi's earlier comments.  AFAICT it's mostly
smaller items, but it would be worth the discussion to see if/where some
larger improvements to existing iscsi-target code can be made beyond the
initial merge.

That said, this series has been added as-is to
target-pending/for-next-merge, to be picked up for the first round of
linux-next integration for drivers/net/ethernet/chelsio/ vs. DaveM's net
tree, and 0-day build testing.

Let's plan a RFC-v2 follow up sometime next week to address individual
comments, and to git squash patches #27-34 into a single merge-able
commit.

Thank you,

--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: [RESEND PATCH v2] scsi: gdth: replace struct timeval with ktime_get_real_seconds()

2016-02-25 Thread Martin K. Petersen
> "Alison" == Alison Schofield  writes:

Alison> struct timeval will overflow on 32-bit systems in y2038 and is
Alison> being removed from the kernel. Replace the use of struct timeval
Alison> and do_gettimeofday() with ktime_get_real_seconds() which
Alison> provides a 64-bit seconds value and is y2038 safe.

Applied to 4.6/scsi-queue.

-- 
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 v2] osd: remove deadcode

2016-02-25 Thread Martin K. Petersen
> "Sudip" == Sudip Mukherjee  writes:

Sudip> The variable is_ver1 is always true and so OSD_CAP_LEN can never
Sudip> be used.  Reported by Coverity.

Applied to 4.6/scsi-queue.

-- 
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] imm: check parport_claim

2016-02-25 Thread Martin K. Petersen
> "Sudip" == Sudip Mukherjee  writes:

Sudip> parport_claim() can fail and we should be checking if we were
Sudip> able to claim the port.

Applied to 4.6/scsi-queue.

-- 
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] snic: correctly check for array overrun on overly long version number

2016-02-25 Thread Colin King
From: Colin Ian King 

The snic version number is expected to be 4 decimals in the form like
a netmask string with each number stored in an element in array v.
However, there is an off-by-one check on the number of elements in v
allowing one to pass a 5 decimal version number causing v[4] to be
referenced, causing a buffer overrun.  Fix the off-by-one error by
comparing to i > 3 rather than 4.

Signed-off-by: Colin Ian King 
---
 drivers/scsi/snic/snic_ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/snic/snic_ctl.c b/drivers/scsi/snic/snic_ctl.c
index aebe753..ab0e06b 100644
--- a/drivers/scsi/snic/snic_ctl.c
+++ b/drivers/scsi/snic/snic_ctl.c
@@ -75,7 +75,7 @@ snic_ver_enc(const char *s)
continue;
}
 
-   if (i > 4 || !isdigit(c))
+   if (i > 3 || !isdigit(c))
goto end;
 
v[i] = v[i] * 10 + (c - '0');
-- 
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


我的交友信息在

2016-02-25 Thread 我的交友信息在
你的老朋友邀你来Q群:343257759


[PATCHv2] iscsi_ibft: Add prefix-len attr and display netmask

2016-02-25 Thread Lee Duncan
From: Hannes Reinecke 

The iBFT table only specifies a prefix length, not a netmask.
And the netmask is pretty much pointless for IPv6.
So introduce a new attribute 'prefix-len' and display the
netmask attribute only for IPv4 addresses.

Some older user-space code might rely on the netmask attribute
being present, so we should always display it.

Changes from v1:
 - Combined two patches into one

Signed-off-by: Hannes Reinecke 
Signed-off-by: Lee Duncan 
---
 drivers/firmware/iscsi_ibft.c| 4 
 drivers/scsi/iscsi_boot_sysfs.c  | 5 +
 include/linux/iscsi_boot_sysfs.h | 1 +
 3 files changed, 10 insertions(+)

diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 72791232e46b..81037e5fe301 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -319,6 +319,9 @@ static ssize_t ibft_attr_show_nic(void *data, int type, 
char *buf)
val = cpu_to_be32(~((1 << (32-nic->subnet_mask_prefix))-1));
str += sprintf(str, "%pI4", &val);
break;
+   case ISCSI_BOOT_ETH_PREFIX_LEN:
+   str += sprintf(str, "%d\n", nic->subnet_mask_prefix);
+   break;
case ISCSI_BOOT_ETH_ORIGIN:
str += sprintf(str, "%d\n", nic->origin);
break;
@@ -460,6 +463,7 @@ static umode_t ibft_check_nic_for(void *data, int type)
if (address_not_null(nic->ip_addr))
rc = S_IRUGO;
break;
+   case ISCSI_BOOT_ETH_PREFIX_LEN:
case ISCSI_BOOT_ETH_SUBNET_MASK:
if (nic->subnet_mask_prefix)
rc = S_IRUGO;
diff --git a/drivers/scsi/iscsi_boot_sysfs.c b/drivers/scsi/iscsi_boot_sysfs.c
index 680bf6f0ce76..8f0ea97cf31f 100644
--- a/drivers/scsi/iscsi_boot_sysfs.c
+++ b/drivers/scsi/iscsi_boot_sysfs.c
@@ -166,6 +166,7 @@ static struct attribute_group iscsi_boot_target_attr_group 
= {
 iscsi_boot_rd_attr(eth_index, index, ISCSI_BOOT_ETH_INDEX);
 iscsi_boot_rd_attr(eth_flags, flags, ISCSI_BOOT_ETH_FLAGS);
 iscsi_boot_rd_attr(eth_ip, ip-addr, ISCSI_BOOT_ETH_IP_ADDR);
+iscsi_boot_rd_attr(eth_prefix, prefix-len, ISCSI_BOOT_ETH_PREFIX_LEN);
 iscsi_boot_rd_attr(eth_subnet, subnet-mask, ISCSI_BOOT_ETH_SUBNET_MASK);
 iscsi_boot_rd_attr(eth_origin, origin, ISCSI_BOOT_ETH_ORIGIN);
 iscsi_boot_rd_attr(eth_gateway, gateway, ISCSI_BOOT_ETH_GATEWAY);
@@ -181,6 +182,7 @@ static struct attribute *ethernet_attrs[] = {
&iscsi_boot_attr_eth_index.attr,
&iscsi_boot_attr_eth_flags.attr,
&iscsi_boot_attr_eth_ip.attr,
+   &iscsi_boot_attr_eth_prefix.attr,
&iscsi_boot_attr_eth_subnet.attr,
&iscsi_boot_attr_eth_origin.attr,
&iscsi_boot_attr_eth_gateway.attr,
@@ -208,6 +210,9 @@ static umode_t iscsi_boot_eth_attr_is_visible(struct 
kobject *kobj,
else if (attr ==  &iscsi_boot_attr_eth_ip.attr)
return boot_kobj->is_visible(boot_kobj->data,
 ISCSI_BOOT_ETH_IP_ADDR);
+   else if (attr ==  &iscsi_boot_attr_eth_prefix.attr)
+   return boot_kobj->is_visible(boot_kobj->data,
+ISCSI_BOOT_ETH_PREFIX_LEN);
else if (attr ==  &iscsi_boot_attr_eth_subnet.attr)
return boot_kobj->is_visible(boot_kobj->data,
 ISCSI_BOOT_ETH_SUBNET_MASK);
diff --git a/include/linux/iscsi_boot_sysfs.h b/include/linux/iscsi_boot_sysfs.h
index 2a8b1659bf35..548d55395488 100644
--- a/include/linux/iscsi_boot_sysfs.h
+++ b/include/linux/iscsi_boot_sysfs.h
@@ -23,6 +23,7 @@ enum iscsi_boot_eth_properties_enum {
ISCSI_BOOT_ETH_INDEX,
ISCSI_BOOT_ETH_FLAGS,
ISCSI_BOOT_ETH_IP_ADDR,
+   ISCSI_BOOT_ETH_PREFIX_LEN,
ISCSI_BOOT_ETH_SUBNET_MASK,
ISCSI_BOOT_ETH_ORIGIN,
ISCSI_BOOT_ETH_GATEWAY,
-- 
1.8.5.2

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


[PATCHv2] Enable iBFT IPv6 booting with prefix length

2016-02-25 Thread Lee Duncan
It turns out that IPv6 doesn't care about netmask, but
instead uses "prefix length" to determine the subnet, but
the iBFT subsystem still just supports netmask.

These two patches enable IPv6 iBFT (iscsi booting)
by adding support for IPv6 prefix and prefix length.
Open-iscsi changes to use these new values will be
introduced once these changes are present.

Hannes Reinecke (1):
  iscsi_ibft: Add prefix-len attr and display netmask

 drivers/firmware/iscsi_ibft.c| 4 
 drivers/scsi/iscsi_boot_sysfs.c  | 5 +
 include/linux/iscsi_boot_sysfs.h | 1 +
 3 files changed, 10 insertions(+)

-- 
1.8.5.2

--
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] ipr: Fix regression when loading firmware

2016-02-25 Thread Gabriel Krisman Bertazi
Commit d63c7dd5bcb9 ("ipr: Fix out-of-bounds null overwrite") removed the
end of line handling when storing the update_fw sysfs attribute.  This
changed the userpace API because it started refusing writes terminated
by a line feed, which broke the update tools we already have.

This patch re-adds that handling, so both a write terminated by a line
feed or not can make it through with the update.

Fixes: d63c7dd5bcb9 ("ipr: Fix out-of-bounds null overwrite")
Signed-off-by: Gabriel Krisman Bertazi 
Cc: Insu Yun 
---
 drivers/scsi/ipr.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 3b3e099..d6a691e 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -4002,6 +4002,7 @@ static ssize_t ipr_store_update_fw(struct device *dev,
struct ipr_sglist *sglist;
char fname[100];
char *src;
+   char *endline;
int result, dnld_size;
 
if (!capable(CAP_SYS_ADMIN))
@@ -4009,6 +4010,10 @@ static ssize_t ipr_store_update_fw(struct device *dev,
 
snprintf(fname, sizeof(fname), "%s", buf);
 
+   endline = strchr(fname, '\n');
+   if (endline)
+   *endline = '\0';
+
if (request_firmware(&fw_entry, fname, &ioa_cfg->pdev->dev)) {
dev_err(&ioa_cfg->pdev->dev, "Firmware file %s not found\n", 
fname);
return -EIO;
-- 
2.1.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 2/2] iscsi_ibft: Always display netmask

2016-02-25 Thread Lee Duncan
On 02/01/2016 10:45 PM, Mike Christie wrote:
> On 01/22/2016 01:49 PM, Lee Duncan wrote:
>> From: Hannes Reinecke 
>>
>> Some older user-space code might rely on the netmask attribute
>> being present, so we should always display it.
>> This fixes a regression introduced by commit
>> 0b2eb3c4060a16f3ec11a4d6d4c934e7e5d5334f.
>>
>> Signed-off-by: Hannes Reinecke 
>> Signed-off-by: Lee Duncan 
>> ---
>>  drivers/firmware/iscsi_ibft.c | 8 +---
>>  1 file changed, 1 insertion(+), 7 deletions(-)
>>
>> diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
>> index 2dd1fbb8..81037e5fe301 100644
>> --- a/drivers/firmware/iscsi_ibft.c
>> +++ b/drivers/firmware/iscsi_ibft.c
>> @@ -464,14 +464,8 @@ static umode_t ibft_check_nic_for(void *data, int type)
>>  rc = S_IRUGO;
>>  break;
>>  case ISCSI_BOOT_ETH_PREFIX_LEN:
>> -if (nic->subnet_mask_prefix)
>> -rc = S_IRUGO;
>> -break;
>>  case ISCSI_BOOT_ETH_SUBNET_MASK:
>> -if (!memcmp(nic->ip_addr, nulls, 10) &&
>> -(nic->ip_addr[10] == 0xff) &&
>> -(nic->ip_addr[11] == 0xff) &&
>> -nic->subnet_mask_prefix)
>> +if (nic->subnet_mask_prefix)
>>  rc = S_IRUGO;
>>  break;
>>  case ISCSI_BOOT_ETH_ORIGIN:
>>
> 
> Sorry. I thought I sent this mail already.
> 
> Is the commit id above supposed to be referencing the first patch? I
> could not match it to anything. If so, then shouldn't this patch just be
> combined with the second patch and some comment about us always
> displaying it for compat reasons added to the code?
> 
> Also, you should normally cc Konrad for iscsi_ibft.c patches, because he
> is actually the maintainer.

Hi Mike:

I'm sorry I didn't reply sooner. I let this get buried in a side folder
and missed it.

The commit ID in Patch 2 was from the SUSE repository. The bottom line
is that I think you are correct, these two patches could easily be
combined. I will resubmit them as one combined patch.

I submitted them as two because I was just feeding patching that Hannes
had done upstream, but I should have noticed they could be combined.
-- 
Lee Duncan
SUSE Labs
--
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


Aw: Re: [BUG] "block: make generic_make_request handle arbitrarily sized bios" breaks boot on parisc-linux

2016-02-25 Thread Helge Deller
> On Thu, Feb 25, 2016 at 7:28 AM, John David Anglin  
> wrote:
> > On 2016-02-24, at 4:36 PM, Helge Deller wrote:
> >
> >> Maybe Dave has more luck, otherwise I'll continue to try to get some info.
> >
> > I tried your patch on the commit in linux-block which first failed to boot. 
> >  As with Helge, the
> > system crashed and no useful data was output on console.  I then applied 
> > following patch
> > to give some extra segments and tired again:
> >
> > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> > index b1a2631..b421f03 100644
> > --- a/drivers/scsi/scsi_lib.c
> > +++ b/drivers/scsi/scsi_lib.c
> > @@ -595,6 +595,11 @@ static int scsi_alloc_sgtable(struct scsi_data_buffer 
> > *sdb, int nents, bool mq)
> >
> > BUG_ON(!nents);
> >
> > +   /* Provide extra entries in case of split.  */
> > +   nents += 8;
> > +   if (nents > SCSI_MAX_SG_SEGMENTS)
> > +   nents = SCSI_MAX_SG_SEGMENTS;
> > +
> 
> Yeah, this is needed for sake of safety.
> 
> > if (mq) {
> > if (nents <= SCSI_MAX_SG_SEGMENTS) {
> > sdb->table.nents = nents;
> >
> > The attached file shows the crash in first boot.  The second boot was 
> > successful and various output
> > was generated by your check code.
> 
> From the following log(just select one simple, and looks all are similar) in
> 2nd boot, the bi_phys_segments is figured out as one by block core
> , which is wrong because the max segment size is 64k according to
> your investigation in the below link, but the whole req/bio is 192k(4k*48).
> 
> http://www.spinics.net/lists/linux-parisc/msg06749.html
> 
> Looks weird, it shouldn't have happened because blk_bio_segment_split()
> does respect the max segment size limit.
> 
> BTW, what is the scsi driver for the device?

It happens with various drivers.
sym53c8xx (on my machine) and mptspi (Fusion MPT, on Daves machine).
Then we have PATA/SATA controllers too: sil680, sata_sil24, pata_ns87415.
The problem can be reproduced by using sym53c8xx or mptsi and blacklisting all 
others.

Helge
--
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 v2 5/6] hisi_sas: add hisi_sas_slave_configure()

2016-02-25 Thread John Garry
In high-datarate aging tests, it is found that the
SCSI framework can periodically issue lu resets as
some commands timeout.
Response TASK SET FULL and SAS_QUEUE_FULL may be
returned many times for the same command, causing the
timeouts.
The SAS_QUEUE_FULL errors come from
TRANS_TX_CREDIT_TIMEOUT_ERR, TRANS_TX_CLOSE_NORMAL_ERR,
and TRANS_TX_ERR_FRAME_TXED errors. They do not mean
that the queue is full in the host, but rather it is
equivalent to meaning the queue is full for the sdev.
To overcome this, the queue depth for the sdev is
reduced to 64 (from 256, set in sas_slave_configure()).
Normally error code SAS_QUEUE_FULL will result in the
sdev queue depth falling, but it falls too slowly during
high-datarate tests and commands timeout before it
has fallen to an adequete level from original value.

Signed-off-by: John Garry 
---
 drivers/scsi/hisi_sas/hisi_sas_main.c | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c 
b/drivers/scsi/hisi_sas/hisi_sas_main.c
index e51612f..097ab4f 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -453,6 +453,19 @@ static int hisi_sas_dev_found(struct domain_device *device)
return 0;
 }
 
+static int hisi_sas_slave_configure(struct scsi_device *sdev)
+{
+   struct domain_device *dev = sdev_to_domain_dev(sdev);
+   int ret = sas_slave_configure(sdev);
+
+   if (ret)
+   return ret;
+   if (!dev_is_sata(dev))
+   sas_change_queue_depth(sdev, 64);
+
+   return 0;
+}
+
 static void hisi_sas_scan_start(struct Scsi_Host *shost)
 {
struct hisi_hba *hisi_hba = shost_priv(shost);
@@ -990,7 +1003,7 @@ static struct scsi_host_template hisi_sas_sht = {
.name   = DRV_NAME,
.queuecommand   = sas_queuecommand,
.target_alloc   = sas_target_alloc,
-   .slave_configure= sas_slave_configure,
+   .slave_configure= hisi_sas_slave_configure,
.scan_finished  = hisi_sas_scan_finished,
.scan_start = hisi_sas_scan_start,
.change_queue_depth = sas_change_queue_depth,
-- 
1.9.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 v2 3/6] hisi_sas: use slot abort in v1 hw

2016-02-25 Thread John Garry
When TRANS_TX_CREDIT_TIMEOUT_ERR or
TRANS_TX_CLOSE_NORMAL_ERR error occur in
a slot, the command should be re-attempted.
This error is equivalent to meaning that the queue
is full in the sdev (and not the host).

Signed-off-by: John Garry 
---
 drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c 
b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
index ce5f65d..1abbc2e 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
@@ -1212,6 +1212,14 @@ static void slot_err_v1_hw(struct hisi_hba *hisi_hba,
ts->stat = SAS_NAK_R_ERR;
break;
}
+   case TRANS_TX_CREDIT_TIMEOUT_ERR:
+   case TRANS_TX_CLOSE_NORMAL_ERR:
+   {
+   /* This will request a retry */
+   ts->stat = SAS_QUEUE_FULL;
+   slot->abort = 1;
+   break;
+   }
default:
{
ts->stat = SAM_STAT_CHECK_CONDITION;
@@ -1319,6 +1327,11 @@ static int slot_complete_v1_hw(struct hisi_hba *hisi_hba,
!(cmplt_hdr_data & CMPLT_HDR_RSPNS_XFRD_MSK)) {
 
slot_err_v1_hw(hisi_hba, task, slot);
+   if (unlikely(slot->abort)) {
+   queue_work(hisi_hba->wq, &slot->abort_slot);
+   /* immediately return and do not complete */
+   return ts->stat;
+   }
goto out;
}
 
-- 
1.9.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 v2 0/6] hisi_sas: add abort and retry feature

2016-02-25 Thread John Garry
This patchset introduces support to abort
certain commands which have failed and retry.
Certain errors require that the command be
retried, like TRANS_TX_CREDIT_TIMEOUT_ERR in
v1 hw.
However, when these errors occur the IO may
still be in the device, so the IO must first
be aborted, and then retried. The HiSilicon
SAS controller has no FW to do this work, so
it needs to be done manually.

Differences to v1:
 - check for tmf success result removed
 - remove query for task prior to abort
 - add flag to slot structure for task abort
 - add removal of superflous debug statement

John Garry (6):
  hisi_sas: change tmf func complete check
  hisi_sas: add hisi_sas_slot_abort()
  hisi_sas: use slot abort in v1 hw
  hisi_sas: use slot abort in v2 hw
  hisi_sas: add hisi_sas_slave_configure()
  hisi_sas: update driver version to 1.3

 drivers/scsi/hisi_sas/hisi_sas.h   |  4 ++-
 drivers/scsi/hisi_sas/hisi_sas_main.c  | 59 --
 drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 13 
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 15 +++--
 4 files changed, 85 insertions(+), 6 deletions(-)

-- 
1.9.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 v2 2/6] hisi_sas: add hisi_sas_slot_abort()

2016-02-25 Thread John Garry
Add a function to abort a slot (task) in the target
device and then cleanup and complete the task.
The function is called from work queue context as
it cannot be called from the context where it is
triggered (interrupt).
Flag hisi_sas_slot.abort is added as the flag used
in the slot error handler to indicate whether the
slot needs to be aborted in the sdev prior to
cleanup and finish.

Signed-off-by: John Garry 
---
 drivers/scsi/hisi_sas/hisi_sas.h  |  2 ++
 drivers/scsi/hisi_sas/hisi_sas_main.c | 42 +++
 2 files changed, 44 insertions(+)

diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h
index 02da7e4..c92e65b 100644
--- a/drivers/scsi/hisi_sas/hisi_sas.h
+++ b/drivers/scsi/hisi_sas/hisi_sas.h
@@ -112,6 +112,7 @@ struct hisi_sas_slot {
int cmplt_queue;
int cmplt_queue_slot;
int idx;
+   int abort;
void*cmd_hdr;
dma_addr_t cmd_hdr_dma;
void*status_buffer;
@@ -120,6 +121,7 @@ struct hisi_sas_slot {
dma_addr_t command_table_dma;
struct hisi_sas_sge_page *sge_page;
dma_addr_t sge_page_dma;
+   struct work_struct abort_slot;
 };
 
 struct hisi_sas_tmf_task {
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c 
b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 58ca336..e51612f 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -15,6 +15,9 @@
 #define DEV_IS_GONE(dev) \
((!dev) || (dev->dev_type == SAS_PHY_UNUSED))
 
+static int hisi_sas_debug_issue_ssp_tmf(struct domain_device *device,
+   u8 *lun, struct hisi_sas_tmf_task *tmf);
+
 static struct hisi_hba *dev_to_hisi_hba(struct domain_device *device)
 {
return device->port->ha->lldd_ha;
@@ -113,6 +116,44 @@ static int hisi_sas_task_prep_ata(struct hisi_hba 
*hisi_hba,
return hisi_hba->hw->prep_stp(hisi_hba, slot);
 }
 
+/*
+ * This function will issue an abort TMF regardless of whether the
+ * task is in the sdev or not. Then it will do the task complete
+ * cleanup and callbacks.
+ */
+static void hisi_sas_slot_abort(struct work_struct *work)
+{
+   struct hisi_sas_slot *abort_slot =
+   container_of(work, struct hisi_sas_slot, abort_slot);
+   struct sas_task *task = abort_slot->task;
+   struct hisi_hba *hisi_hba = dev_to_hisi_hba(task->dev);
+   struct scsi_cmnd *cmnd = task->uldd_task;
+   struct hisi_sas_tmf_task tmf_task;
+   struct domain_device *device = task->dev;
+   struct hisi_sas_device *sas_dev = device->lldd_dev;
+   struct scsi_lun lun;
+   struct device *dev = &hisi_hba->pdev->dev;
+   int tag = abort_slot->idx;
+
+   if (!(task->task_proto & SAS_PROTOCOL_SSP)) {
+   dev_err(dev, "cannot abort slot for non-ssp task\n");
+   goto out;
+   }
+
+   int_to_scsilun(cmnd->device->lun, &lun);
+   tmf_task.tmf = TMF_ABORT_TASK;
+   tmf_task.tag_of_task_to_be_managed = cpu_to_le16(tag);
+
+   hisi_sas_debug_issue_ssp_tmf(task->dev, lun.scsi_lun, &tmf_task);
+out:
+   /* Do cleanup for this task */
+   hisi_sas_slot_task_free(hisi_hba, task, abort_slot);
+   if (task->task_done)
+   task->task_done(task);
+   if (sas_dev && sas_dev->running_req)
+   sas_dev->running_req--;
+}
+
 static int hisi_sas_task_prep(struct sas_task *task, struct hisi_hba *hisi_hba,
  int is_tmf, struct hisi_sas_tmf_task *tmf,
  int *pass)
@@ -206,6 +247,7 @@ static int hisi_sas_task_prep(struct sas_task *task, struct 
hisi_hba *hisi_hba,
slot->task = task;
slot->port = port;
task->lldd_task = slot;
+   INIT_WORK(&slot->abort_slot, hisi_sas_slot_abort);
 
slot->status_buffer = dma_pool_alloc(hisi_hba->status_buffer_pool,
 GFP_ATOMIC,
-- 
1.9.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 v2 6/6] hisi_sas: update driver version to 1.3

2016-02-25 Thread John Garry
Signed-off-by: John Garry 
---
 drivers/scsi/hisi_sas/hisi_sas.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h
index c92e65b..29e89f3 100644
--- a/drivers/scsi/hisi_sas/hisi_sas.h
+++ b/drivers/scsi/hisi_sas/hisi_sas.h
@@ -23,7 +23,7 @@
 #include 
 #include 
 
-#define DRV_VERSION "v1.2"
+#define DRV_VERSION "v1.3"
 
 #define HISI_SAS_MAX_PHYS  9
 #define HISI_SAS_MAX_QUEUES32
-- 
1.9.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 v2 1/6] hisi_sas: change tmf func complete check

2016-02-25 Thread John Garry
In hisi_sas_exec_internal_tmf_task(), the check for
SAM_STAT_GOOD is replaced with
TMF_RESP_FUNC_COMPLETE, which is a genuine tmf
response code.
SAM_STAT_GOOD and TMF_RESP_FUNC_COMPLETE have the
same value, so this is why it worked before.

Signed-off-by: John Garry 
---
 drivers/scsi/hisi_sas/hisi_sas_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c 
b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 2194917..58ca336 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -661,7 +661,7 @@ static int hisi_sas_exec_internal_tmf_task(struct 
domain_device *device,
}
 
if (task->task_status.resp == SAS_TASK_COMPLETE &&
-   task->task_status.stat == SAM_STAT_GOOD) {
+task->task_status.stat == TMF_RESP_FUNC_COMPLETE) {
res = TMF_RESP_FUNC_COMPLETE;
break;
}
-- 
1.9.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 v2 4/6] hisi_sas: use slot abort in v2 hw

2016-02-25 Thread John Garry
When TRANS_TX_ERR_FRAME_TXED error occurs in
a slot, the command should be re-attempted.
This error is equivalent to meaning that the queue
is full in the sdev (and not the host).
A superflous debug statement is also removed in the
slot complete handler.

Signed-off-by: John Garry 
---
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c 
b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index 58e1956..b733747 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -1299,6 +1299,13 @@ static void slot_err_v2_hw(struct hisi_hba *hisi_hba,
ts->stat = SAS_DATA_UNDERRUN;
break;
}
+   case TRANS_TX_ERR_FRAME_TXED:
+   {
+   /* This will request a retry */
+   ts->stat = SAS_QUEUE_FULL;
+   slot->abort = 1;
+   break;
+   }
case TRANS_TX_OPEN_FAIL_WITH_IT_NEXUS_LOSS:
case TRANS_TX_ERR_PHY_NOT_ENABLE:
case TRANS_TX_OPEN_CNX_ERR_BY_OTHER:
@@ -1491,11 +1498,13 @@ slot_complete_v2_hw(struct hisi_hba *hisi_hba, struct 
hisi_sas_slot *slot,
 
if ((complete_hdr->dw0 & CMPLT_HDR_ERX_MSK) &&
(!(complete_hdr->dw0 & CMPLT_HDR_RSPNS_XFRD_MSK))) {
-   dev_dbg(dev, "%s slot %d has error info 0x%x\n",
-   __func__, slot->cmplt_queue_slot,
-   complete_hdr->dw0 & CMPLT_HDR_ERX_MSK);
 
slot_err_v2_hw(hisi_hba, task, slot);
+   if (unlikely(slot->abort)) {
+   queue_work(hisi_hba->wq, &slot->abort_slot);
+   /* immediately return and do not complete */
+   return ts->stat;
+   }
goto out;
}
 
-- 
1.9.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