[PATCH 3/5] scsi: Unlock accesses to eh_deadline

2013-11-04 Thread Hannes Reinecke
32bit accesses are guaranteed to be atomic, so we can remove the spinlock when checking for eh_deadline. We only need to make sure to catch any updates which might happened during the call to time_before(); if so we just recheck with the correct value. Signed-off-by: Hannes Reinecke --- drivers/

[PATCH 1/5] scsi: Fix erratic device offline during EH

2013-11-04 Thread Hannes Reinecke
From: James Bottomley Commit 18a4d0a22ed6c54b67af7718c305cd010f09ddf8 (Handle disk devices which can not process medium access commands) was introduced to offline any device which cannot process medium access commands. However, commit 3eef6257de48ff84a5d98ca533685df8a3beaeb8 (Reduce error recover

[PATCHv10 0/5] New EH command timeout handler

2013-11-04 Thread Hannes Reinecke
Hi all, this patchset implements a new SCSI EH command timeout handler which will be sending command aborts inline without actually engaging SCSI EH. SCSI EH will only be invoked if command abort fails. In addition the commands will be returned directly if the command abort succeeded, cutting dow

[PATCH 4/5] scsi: Set the minimum valid value of 'eh_deadline' as 0

2013-11-04 Thread Hannes Reinecke
From: Ren Mingxin The former minimum valid value of 'eh_deadline' is 1s, which means the earliest occasion to shorten EH is 1 second later since a command is failed or timed out. But if we want to skip EH steps ASAP, we have to wait until the first EH step is finished. If the duration of the firs

[PATCH 5/5] scsi: Update documentation

2013-11-04 Thread Hannes Reinecke
The documentation has gone out-of-sync, so update it to the current status. Signed-off-by: Hannes Reinecke --- Documentation/scsi/scsi_eh.txt | 69 +++-- Documentation/scsi/scsi_mid_low_api.txt | 9 - drivers/scsi/scsi.c | 6 +-- 3 f

[PATCH 2/5] scsi: improved eh timeout handler

2013-11-04 Thread Hannes Reinecke
When a command runs into a timeout we need to send an 'ABORT TASK' TMF. This is typically done by the 'eh_abort_handler' LLDD callback. Conceptually, however, this function is a normal SCSI command, so there is no need to enter the error handler. This patch implements a new scsi_abort_command() f

Re: [PATCH 2/2] libata: avoid waking disk to check power

2013-11-04 Thread Phillip Susi
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 11/04/2013 09:39 PM, Aaron Lu wrote: > If the disk entered sleep mode due to runtime PM, then udisks can > easily tell by checking the device's runtime status and not send > out the query. > > But if the disk entered sleep mode due to other reaso

Re: [PATCH 1/2] libata: use sleep instead of standby command

2013-11-04 Thread Aaron Lu
On 11/05/2013 10:39 AM, Phillip Susi wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > On 11/04/2013 09:23 PM, Aaron Lu wrote: >> I suppose this is mainly for runtime PM? Since for system >> suspend/hibernation, the disk and its controller will be powered >> off anyway. > > Yes, or

Re: [PATCH 1/2] libata: use sleep instead of standby command

2013-11-04 Thread Phillip Susi
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 11/04/2013 09:23 PM, Aaron Lu wrote: > I suppose this is mainly for runtime PM? Since for system > suspend/hibernation, the disk and its controller will be powered > off anyway. Yes, or the second patch also helps when one manually issues hdparm

Re: [PATCH 2/2] libata: avoid waking disk to check power

2013-11-04 Thread Aaron Lu
+linux-ide On 11/05/2013 08:53 AM, Phillip Susi wrote: > When a disk is in SLEEP mode it can not respond to commands, > including the CHECK POWER command. Instead of waking up the > sleeping disk, fake the reply to the CHECK POWER command to > indicate the disk is in standby mode. This prevents

Disk wakeup on resume

2013-11-04 Thread Phillip Susi
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 I can not figure out what is waking up disks on resume from suspend. I thought it was sd.c, and setting manage_start_stop = 0 should stop that. It does stop the message printed saying it is being started, yet the disk is still started, and this make

Re: [PATCH 1/2] libata: use sleep instead of standby command

2013-11-04 Thread Aaron Lu
+linux-ide On 11/05/2013 08:52 AM, Phillip Susi wrote: > The ATA SLEEP mode saves some more power than SUSPEND, and > has basically the same recovery time, so use it instead. I suppose this is mainly for runtime PM? Since for system suspend/hibernation, the disk and its controller will be powered

Re: [PATCH 2/3] scsi: improved eh timeout handler

2013-11-04 Thread James Bottomley
On Mon, 2013-11-04 at 16:43 +0100, Hannes Reinecke wrote: > On 11/04/2013 03:50 PM, James Bottomley wrote: > > On Mon, 2013-11-04 at 15:46 +0100, Hannes Reinecke wrote: > >> On 11/04/2013 03:25 PM, James Bottomley wrote: > >>> On Mon, 2013-11-04 at 14:36 +0100, Hannes Reinecke wrote: > On 10/3

[PATCH 2/2] libata: avoid waking disk to check power

2013-11-04 Thread Phillip Susi
When a disk is in SLEEP mode it can not respond to commands, including the CHECK POWER command. Instead of waking up the sleeping disk, fake the reply to the CHECK POWER command to indicate the disk is in standby mode. This prevents udisks from waking up sleeping disks when it polls to see if the

[PATCH 1/2] libata: use sleep instead of standby command

2013-11-04 Thread Phillip Susi
The ATA SLEEP mode saves some more power than SUSPEND, and has basically the same recovery time, so use it instead. Signed-off-by: Phillip Susi --- drivers/ata/libata-scsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scs

Re: scsi-mq + open-iscsi support patches..?

2013-11-04 Thread Nicholas A. Bellinger
On Sat, 2013-11-02 at 16:10 +, Jayamohan Kallickal wrote: > >> On a related note, some iscsi vendor has been hitting a crash with > >> your tree. > > >I got an email from Jayamohan recently, but the OOPs did not appear to be > >scsi-mq related.. > > I do see the crash on my Ubuntu VM run

Re: [PATCH 2/3] scsi: improved eh timeout handler

2013-11-04 Thread Hannes Reinecke
On 11/04/2013 03:50 PM, James Bottomley wrote: > On Mon, 2013-11-04 at 15:46 +0100, Hannes Reinecke wrote: >> On 11/04/2013 03:25 PM, James Bottomley wrote: >>> On Mon, 2013-11-04 at 14:36 +0100, Hannes Reinecke wrote: On 10/31/2013 04:49 PM, Christoph Hellwig wrote: > Looks reasonable to

Re: [PATCH v6 2/2] block,scsi: convert and handle ERR_PTR from blk_get_request

2013-11-04 Thread Boaz Harrosh
On 10/31/2013 03:50 PM, Joe Lawrence wrote: > The blk_get_request function may fail in low-memory conditions or during > device removal (even if __GFP_WAIT is set). To distinguish between these > errors, modify the blk_get_request call stack to return the appropriate > ERR_PTR. Verify that all call

Re: [PATCH 2/3] scsi: improved eh timeout handler

2013-11-04 Thread James Bottomley
On Mon, 2013-11-04 at 15:46 +0100, Hannes Reinecke wrote: > On 11/04/2013 03:25 PM, James Bottomley wrote: > > On Mon, 2013-11-04 at 14:36 +0100, Hannes Reinecke wrote: > >> On 10/31/2013 04:49 PM, Christoph Hellwig wrote: > >>> Looks reasonable to me, but a few minor nitpicks: > >>> > +

Re: [PATCH 2/3] scsi: improved eh timeout handler

2013-11-04 Thread Hannes Reinecke
On 11/04/2013 03:25 PM, James Bottomley wrote: > On Mon, 2013-11-04 at 14:36 +0100, Hannes Reinecke wrote: >> On 10/31/2013 04:49 PM, Christoph Hellwig wrote: >>> Looks reasonable to me, but a few minor nitpicks: >>> + spin_lock_irqsave(sdev->host->host_lock, flags); + if (scsi_host_eh_

Re: [PATCH 2/3] scsi: improved eh timeout handler

2013-11-04 Thread James Bottomley
On Mon, 2013-11-04 at 14:36 +0100, Hannes Reinecke wrote: > On 10/31/2013 04:49 PM, Christoph Hellwig wrote: > > Looks reasonable to me, but a few minor nitpicks: > > > >> + spin_lock_irqsave(sdev->host->host_lock, flags); > >> + if (scsi_host_eh_past_deadline(sdev->host)) { > > > > I don't hav

[PATCH 2/4] scsi: improved eh timeout handler

2013-11-04 Thread Hannes Reinecke
When a command runs into a timeout we need to send an 'ABORT TASK' TMF. This is typically done by the 'eh_abort_handler' LLDD callback. Conceptually, however, this function is a normal SCSI command, so there is no need to enter the error handler. This patch implements a new scsi_abort_command() f

[PATCH 1/4] scsi: Fix erratic device offline during EH

2013-11-04 Thread Hannes Reinecke
From: James Bottomley Commit 18a4d0a22ed6c54b67af7718c305cd010f09ddf8 (Handle disk devices which can not process medium access commands) was introduced to offline any device which cannot process medium access commands. However, commit 3eef6257de48ff84a5d98ca533685df8a3beaeb8 (Reduce error recover

[PATCHv9 0/4] New EH command timeout handler

2013-11-04 Thread Hannes Reinecke
Hi all, this patchset implements a new SCSI EH command timeout handler which will be sending command aborts inline without actually engaging SCSI EH. SCSI EH will only be invoked if command abort fails. In addition the commands will be returned directly if the command abort succeeded, cutting dow

[PATCH 4/4] scsi: Update documentation

2013-11-04 Thread Hannes Reinecke
The documentation has gone out-of-sync, so update it to the current status. Signed-off-by: Hannes Reinecke --- Documentation/scsi/scsi_eh.txt | 69 +++-- Documentation/scsi/scsi_mid_low_api.txt | 9 - drivers/scsi/scsi.c | 6 +-- 3 f

[PATCH 3/4] scsi: Set the minimum valid value of 'eh_deadline' as 0

2013-11-04 Thread Hannes Reinecke
From: Ren Mingxin The former minimum valid value of 'eh_deadline' is 1s, which means the earliest occasion to shorten EH is 1 second later since a command is failed or timed out. But if we want to skip EH steps ASAP, we have to wait until the first EH step is finished. If the duration of the firs

Re: [PATCH 2/3] scsi: improved eh timeout handler

2013-11-04 Thread Hannes Reinecke
On 10/31/2013 04:49 PM, Christoph Hellwig wrote: > Looks reasonable to me, but a few minor nitpicks: > >> +spin_lock_irqsave(sdev->host->host_lock, flags); >> +if (scsi_host_eh_past_deadline(sdev->host)) { > > I don't have the implementation of scsi_host_eh_past_deadline in my > local tre

Re: [PATCH 11/11] pm80xx : gpio feature support for motherboard controllers

2013-11-04 Thread Jack Wang
On 11/04/2013 11:13 AM, Viswas G wrote: > Hi Jack, > > We wanted to control the GPIO in the HBA only. Bsg interface gets created > only for enclosure or expander. > > For our HBA, bsg interface will not be created since it does not have an > enclosure target inside. That's why we wanted to use

RE: [PATCH 11/11] pm80xx : gpio feature support for motherboard controllers

2013-11-04 Thread Viswas G
Hi Jack, We wanted to control the GPIO in the HBA only. Bsg interface gets created only for enclosure or expander. For our HBA, bsg interface will not be created since it does not have an enclosure target inside. That's why we wanted to use IOCTL. Please advise. Best Regards, Viswas G -O

[PATCH] scsi: Do not call do_div() with a 64-bit divisor

2013-11-04 Thread Geert Uytterhoeven
do_div() is meant for divisions of 64-bit number by 32-bit numbers. Passing 64-bit divisor types caused issues in the past on 32-bit platforms, cfr. commit ea077b1b96e073eac5c3c5590529e964767fc5f7 ("m68k: Truncate base in do_div()"). As scsi_device.sector_size is unsigned (int), factor should be u