[PATCH] scsi: ufs: add missing declaration in ufshcd.h

2016-08-28 Thread Baoyou Xie
We get 1 warning about global functions without a declaration
in the scsi ufshcd driver when building with W=1:
drivers/scsi/ufs/ufshcd.c:1991:5: warning: no previous prototype for 
'ufshcd_query_descriptor_retry' [-Wmissing-prototypes]

in fact, this function is implemented in ufshcd.c and exported
but need to be declared in header file.

Signed-off-by: Baoyou Xie 
---
 drivers/scsi/ufs/ufshcd.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 430bef1..2f696ea 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -713,6 +713,9 @@ int ufshcd_read_string_desc(struct ufs_hba *hba, int 
desc_index, u8 *buf,
 /* Expose Query-Request API */
 int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
enum flag_idn idn, bool *flag_res);
+int ufshcd_query_descriptor_retry(struct ufs_hba *hba,
+   enum query_opcode opcode, enum desc_idn idn, u8 index,
+   u8 selector, u8 *desc_buf, int *buf_len);
 int ufshcd_hold(struct ufs_hba *hba, bool async);
 void ufshcd_release(struct ufs_hba *hba);
 u32 ufshcd_get_local_unipro_ver(struct ufs_hba *hba);
-- 
2.7.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/3] documentation/scsi: Remove nodisconnect parameter

2016-08-28 Thread Geert Uytterhoeven
On Sat, Aug 27, 2016 at 4:29 AM, Finn Thain  wrote:
> The driver that used the 'nodisconnect' parameter was removed in
> commit 565bae6a4a8f ("[SCSI] 53c7xx: kill driver"). Related documentation
> was cleaned up in commit f37a7238d379 ("[SCSI] 53c7xx: fix removal
> fallout"), except for the remaining two mentions that are removed here.
>
> Signed-off-by: Finn Thain 

Reviewed-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
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 3/3] scsi/ncr5380: Improve interrupt latency during PIO tranfers

2016-08-28 Thread Geert Uytterhoeven
Hi Finn,

On Sat, Aug 27, 2016 at 4:30 AM, Finn Thain  wrote:
> Large PIO transfers are broken up into chunks to try to avoid disabling
> local IRQs for long periods. But IRQs are still disabled for too long
> and this causes SCC FIFO overruns during serial port transfers. This
> patch fixes the problem by halving the PIO chunk size.
>
> Testing with mac_scsi shows that the extra NCR5380_main() loop iterations
> have negligible performance impact on SCSI transfers (about 1% slower).
> On a faster system (using the dmx3191d module) transfers showed no
> measurable change.
>
> Signed-off-by: Finn Thain 
>
> ---
>  drivers/scsi/NCR5380.c |6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> Index: linux/drivers/scsi/NCR5380.c
> ===
> --- linux.orig/drivers/scsi/NCR5380.c   2016-08-27 12:29:57.0 +1000
> +++ linux/drivers/scsi/NCR5380.c2016-08-27 12:29:58.0 +1000
> @@ -1847,11 +1847,11 @@ static void NCR5380_information_transfer
> /* XXX - need to source or 
> sink data here, as appropriate */
> }
> } else {
> -   /* Break up transfer into 3 ms chunks,
> -* presuming 6 accesses per handshake.
> +   /* Transfer a small chunk so that the
> +* irq mode lock is not held too long.
>  */
> transfersize = min((unsigned 
> long)cmd->SCp.this_residual,
> -  
> hostdata->accesses_per_ms / 2);
> +  
> hostdata->accesses_per_ms >> 2);

I think it's easier to read if you use "/ 4".

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
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] scsi/ncr5380: Avoid a compiler warning

2016-08-28 Thread Geert Uytterhoeven
On Sat, Aug 27, 2016 at 4:30 AM, Finn Thain  wrote:
> With commit 3a0f64bfa907 ("mac_scsi: Fix pseudo DMA implementation")
> some versions of gcc now warn:
>
> In file included from drivers/scsi/mac_scsi.c:335:
> drivers/scsi/NCR5380.h:295: warning: `NCR5380_poll_politely' declared inline 
> after being called
> drivers/scsi/NCR5380.h:295: warning: previous declaration of 
> `NCR5380_poll_politely' was here
>
> Avoid this by defining NCR5380_poll_politely() in NCR5380.h.
>
> Suggested-by: Geert Uytterhoeven 
> Signed-off-by: Finn Thain 

Tested-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
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] qla2xxx: fix spelling mistake "retyring" -> "retrying"

2016-08-28 Thread Colin King
From: Colin Ian King 

Trivial fix to spelling mistakes in ql_dbg messages.

Signed-off-by: Colin Ian King 
---
 drivers/scsi/qla2xxx/qla_os.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 1dd8650..ace65db 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -4694,7 +4694,7 @@ retry_unlock:
qla83xx_wait_logic();
retry++;
ql_dbg(ql_dbg_p3p, base_vha, 0xb064,
-   "Failed to release IDC lock, retyring=%d\n", retry);
+   "Failed to release IDC lock, retrying=%d\n", retry);
goto retry_unlock;
}
} else if (retry < 10) {
@@ -4702,7 +4702,7 @@ retry_unlock:
qla83xx_wait_logic();
retry++;
ql_dbg(ql_dbg_p3p, base_vha, 0xb065,
-   "Failed to read drv-lockid, retyring=%d\n", retry);
+   "Failed to read drv-lockid, retrying=%d\n", retry);
goto retry_unlock;
}
 
@@ -4718,7 +4718,7 @@ retry_unlock2:
qla83xx_wait_logic();
retry++;
ql_dbg(ql_dbg_p3p, base_vha, 0xb066,
-   "Failed to release IDC lock, retyring=%d\n", retry);
+   "Failed to release IDC lock, retrying=%d\n", retry);
goto retry_unlock2;
}
}
-- 
2.9.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: fix spelling mistake "retyring" -> "retrying"

2016-08-28 Thread Himanshu Madhani

On 8/28/16, 4:24 AM, "Colin King"  wrote:

>From: Colin Ian King 
>
>Trivial fix to spelling mistakes in ql_dbg messages.
>
>Signed-off-by: Colin Ian King 
>---
> drivers/scsi/qla2xxx/qla_os.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
>index 1dd8650..ace65db 100644
>--- a/drivers/scsi/qla2xxx/qla_os.c
>+++ b/drivers/scsi/qla2xxx/qla_os.c
>@@ -4694,7 +4694,7 @@ retry_unlock:
>   qla83xx_wait_logic();
>   retry++;
>   ql_dbg(ql_dbg_p3p, base_vha, 0xb064,
>-  "Failed to release IDC lock, retyring=%d\n", retry);
>+  "Failed to release IDC lock, retrying=%d\n", retry);
>   goto retry_unlock;
>   }
>   } else if (retry < 10) {
>@@ -4702,7 +4702,7 @@ retry_unlock:
>   qla83xx_wait_logic();
>   retry++;
>   ql_dbg(ql_dbg_p3p, base_vha, 0xb065,
>-  "Failed to read drv-lockid, retyring=%d\n", retry);
>+  "Failed to read drv-lockid, retrying=%d\n", retry);
>   goto retry_unlock;
>   }
> 
>@@ -4718,7 +4718,7 @@ retry_unlock2:
>   qla83xx_wait_logic();
>   retry++;
>   ql_dbg(ql_dbg_p3p, base_vha, 0xb066,
>-  "Failed to release IDC lock, retyring=%d\n", retry);
>+  "Failed to release IDC lock, retrying=%d\n", retry);
>   goto retry_unlock2;
>   }
>   }
>-- 
>2.9.3
>

Thanks Colin. Looks Good. 

Acked-by: Himanshu Madhani 

>


[PATCH] scsi: constify sr_pm_ops structure

2016-08-28 Thread Julia Lawall
sr_pm_ops, of type struct dev_pm_ops, is never modified, so declare it as
const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
 drivers/scsi/sr.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index ed17934..bed2bbd 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -83,7 +83,7 @@ static int sr_init_command(struct scsi_cmnd *SCpnt);
 static int sr_done(struct scsi_cmnd *);
 static int sr_runtime_suspend(struct device *dev);
 
-static struct dev_pm_ops sr_pm_ops = {
+static const struct dev_pm_ops sr_pm_ops = {
.runtime_suspend= sr_runtime_suspend,
 };
 

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


Problem with LIO

2016-08-28 Thread Popovics László
I loose ISCSI target from a client. (iscsi with iser)
On the server side I get the following message if I issue dmesg command

Any idea how can I solve this problem ?

[13433.066229] INFO: task iscsi_trx:4434 blocked for more than 120 seconds.
[13433.069001] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this 
message.
[13433.071766] iscsi_trx   D 88083102f400 0  4434  2 0x0084
[13433.071770]  881054387bf0 0046 880834d02280 
881054387fd8
[13433.071776]  881054387fd8 881054387fd8 880834d02280 
880831295a30
[13433.071781]  880831295a38 7fff 880834d02280 
88083102f400
[13433.071787] Call Trace:
[13433.071793]  [] schedule+0x29/0x70
[13433.071798]  [] schedule_timeout+0x209/0x2d0
[13433.071803]  [] ? schedule+0x29/0x70
[13433.071807]  [] ? schedule_timeout+0x209/0x2d0
[13433.071816]  [] wait_for_completion+0x116/0x170
[13433.071822]  [] ? wake_up_state+0x20/0x20
[13433.071850]  [] target_wait_for_sess_cmds+0x60/0x150 
[target_core_mod]
[13433.071857]  [] isert_wait_conn+0x88/0x180 [ib_isert]
[13433.071869]  [] iscsit_close_connection+0x15d/0x820 
[iscsi_target_mod]
[13433.071878]  [] ? 
wait_for_completion_interruptible+0x167/0x1d0
[13433.071889]  [] ? iscsi_target_tx_thread+0x200/0x200 
[iscsi_target_mod]
[13433.071899]  [] 
iscsit_take_action_for_connection_exit+0x83/0x110 [iscsi_target_mod]
[13433.071913]  [] iscsi_target_rx_thread+0x1e7/0xf80 
[iscsi_target_mod]
[13433.071924]  [] ? __switch_to+0xf8/0x4b0
[13433.071936]  [] ? iscsi_target_tx_thread+0x200/0x200 
[iscsi_target_mod]
[13433.071942]  [] kthread+0xcf/0xe0
[13433.071948]  [] ? kthread_create_on_node+0x140/0x140
[13433.071956]  [] ret_from_fork+0x58/0x90
[13433.071975]  [] ? kthread_create_on_node+0x140/0x140

I’m using kernel version : 3.10.0-327.el7.x86_64
Centos 7 OS
targetcli version 2.1.fb41

After yum update the same occurs.

Thanks, and Best Regards,

Laszlo

--
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 3/3] scsi/ncr5380: Improve interrupt latency during PIO tranfers

2016-08-28 Thread Finn Thain

On Sun, 28 Aug 2016, Geert Uytterhoeven wrote:

> Hi Finn,
> 
> On Sat, Aug 27, 2016 at 4:30 AM, Finn Thain  
> wrote:
> > Large PIO transfers are broken up into chunks to try to avoid 
> > disabling local IRQs for long periods. But IRQs are still disabled for 
> > too long and this causes SCC FIFO overruns during serial port 
> > transfers. This patch fixes the problem by halving the PIO chunk size.
> >
> > Testing with mac_scsi shows that the extra NCR5380_main() loop 
> > iterations have negligible performance impact on SCSI transfers (about 
> > 1% slower). On a faster system (using the dmx3191d module) transfers 
> > showed no measurable change.
> >
> > Signed-off-by: Finn Thain 
> >
> > ---
> >  drivers/scsi/NCR5380.c |6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > Index: linux/drivers/scsi/NCR5380.c
> > ===
> > --- linux.orig/drivers/scsi/NCR5380.c   2016-08-27 12:29:57.0 +1000
> > +++ linux/drivers/scsi/NCR5380.c2016-08-27 12:29:58.0 +1000
> > @@ -1847,11 +1847,11 @@ static void NCR5380_information_transfer
> > /* XXX - need to source or 
> > sink data here, as appropriate */
> > }
> > } else {
> > -   /* Break up transfer into 3 ms 
> > chunks,
> > -* presuming 6 accesses per 
> > handshake.
> > +   /* Transfer a small chunk so that 
> > the
> > +* irq mode lock is not held too 
> > long.
> >  */
> > transfersize = min((unsigned 
> > long)cmd->SCp.this_residual,
> > -  
> > hostdata->accesses_per_ms / 2);
> > +  
> > hostdata->accesses_per_ms >> 2);
> 
> I think it's easier to read if you use "/ 4".

I think the factor, "1/4 byte milliseconds per access" is not very 
meaningful. The PIO transfersize can be understood as,

pio_bytes_until_scc_fifo_overflow = accesses_per_ms /
 (accesses_per_pio_byte / ms_until_fifo_overflow)

This loop seemed like a good place to avoid a DIV instruction (though I 
didn't try to confirm that) and so I used a bit shift to indicate that 
intention.

The shift amount was an empirical result that happened to work for the 
hardware I tested it on, at the baud rate I was using. Admittedly, if we 
want to avoid further tweaks to this then I'll have to do more testing and 
find a better approximation.

-- 

> 
> Gr{oetje,eeting}s,
> 
> Geert
> 
--
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