Re: RFC: Allow block drivers to poll for I/O instead of sleeping

2013-06-25 Thread Bart Van Assche
On 06/25/13 05:18, Matthew Wilcox wrote: On Mon, Jun 24, 2013 at 10:07:51AM +0200, Ingo Molnar wrote: I'm wondering, how will this scheme work if the IO completion latency is a lot more than the 5 usecs in the testcase? What if it takes 20 usecs or 100 usecs or more? There's clearly a threshol

Re: [PATCH v11 3/9] Avoid calling __scsi_remove_device() twice

2013-06-25 Thread Bart Van Assche
On 06/24/13 19:38, James Bottomley wrote: > On Wed, 2013-06-12 at 14:52 +0200, Bart Van Assche wrote: >> SCSI devices are added to the shost->__devices list from inside >> scsi_alloc_sdev(). If something goes wrong during LUN scanning, >> e.g. a transport layer failure occurs, then __scsi_remove_de

Re: [PATCH v11 4/9] Disallow changing the device state via sysfs into "deleted"

2013-06-25 Thread Bart Van Assche
On 06/24/13 19:59, James Bottomley wrote: On Wed, 2013-06-12 at 14:53 +0200, Bart Van Assche wrote: Changing the state of a SCSI device via sysfs into "cancel" or "deleted" prevents removal of these devices by scsi_remove_host(). Hence do not allow this. Also, introduce the symbolic name INVALID

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-25 Thread Bart Van Assche
On 06/25/13 00:27, James Bottomley wrote: On Mon, 2013-06-24 at 15:04 -0500, Mike Christie wrote: On 06/24/2013 02:19 PM, James Bottomley wrote: On Wed, 2013-06-12 at 14:55 +0200, Bart Van Assche wrote: A SCSI LLD may start cleaning up host resources as soon as scsi_remove_host() returns. Thes

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-25 Thread Bart Van Assche
On 06/25/13 00:27, James Bottomley wrote: For a variety of reasons this patch set is incredibly hard to review: Almost every patch touches pieces in the mid layer where you have to be sure in minute detail you know what's going on (and what should be going on), so usually it's a couple of hours w

Re: [PATCH 8/9] scsi/pm8001: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)

2013-06-25 Thread Yijing Wang
Hi, Any comments? On 2013/6/18 16:23, Yijing Wang wrote: > Pci core has been saved pm cap register offset by pdev->pm_cap in > pci_pm_init() > in init path. So we can use pdev->pm_cap instead of using > pci_find_capability(pdev, PCI_CAP_ID_PM) for better performance and > simplified code. > >

Re: [PATCH v11 4/9] Disallow changing the device state via sysfs into "deleted"

2013-06-25 Thread James Bottomley
On Tue, 2013-06-25 at 10:41 +0200, Bart Van Assche wrote: > On 06/24/13 19:59, James Bottomley wrote: > > On Wed, 2013-06-12 at 14:53 +0200, Bart Van Assche wrote: > >> Changing the state of a SCSI device via sysfs into "cancel" or > >> "deleted" prevents removal of these devices by scsi_remove_hos

Re: [PATCH v11 3/9] Avoid calling __scsi_remove_device() twice

2013-06-25 Thread James Bottomley
On Tue, 2013-06-25 at 10:37 +0200, Bart Van Assche wrote: > On 06/24/13 19:38, James Bottomley wrote: > > On Wed, 2013-06-12 at 14:52 +0200, Bart Van Assche wrote: > >> SCSI devices are added to the shost->__devices list from inside > >> scsi_alloc_sdev(). If something goes wrong during LUN scannin

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-25 Thread James Bottomley
On Tue, 2013-06-25 at 11:01 +0200, Bart Van Assche wrote: > On 06/25/13 00:27, James Bottomley wrote: > > On Mon, 2013-06-24 at 15:04 -0500, Mike Christie wrote: > >> On 06/24/2013 02:19 PM, James Bottomley wrote: > >>> On Wed, 2013-06-12 at 14:55 +0200, Bart Van Assche wrote: > A SCSI LLD may

Re: RFC: Allow block drivers to poll for I/O instead of sleeping

2013-06-25 Thread Steven Rostedt
On Mon, 2013-06-24 at 23:07 -0400, Matthew Wilcox wrote: > On Mon, Jun 24, 2013 at 08:11:02PM -0400, Steven Rostedt wrote: > > What about hooking into the idle_balance code? That happens if we are > > about to go to idle but before the full schedule switch to the idle > > task. > > > > > > In __s

Re: RFC: Allow block drivers to poll for I/O instead of sleeping

2013-06-25 Thread Jens Axboe
On Mon, Jun 24 2013, Matthew Wilcox wrote: > On Mon, Jun 24, 2013 at 09:15:45AM +0200, Jens Axboe wrote: > > Willy, I think the general design is fine, hooking in via the bdi is the > > only way to get back to the right place from where you need to sleep. > > Some thoughts: > > > > - This should b

Re: RFC: Allow block drivers to poll for I/O instead of sleeping

2013-06-25 Thread Jens Axboe
On Mon, Jun 24 2013, Steven Rostedt wrote: > On Mon, Jun 24, 2013 at 09:17:18AM +0200, Jens Axboe wrote: > > On Sun, Jun 23 2013, Linus Torvalds wrote: > > > > > > You could try to do that either *in* the idle thread (which would take > > > the context switch overhead - maybe negating some of the

Re: RFC: Allow block drivers to poll for I/O instead of sleeping

2013-06-25 Thread Jens Axboe
On Mon, Jun 24 2013, Matthew Wilcox wrote: > On Mon, Jun 24, 2013 at 10:07:51AM +0200, Ingo Molnar wrote: > > I'm wondering, how will this scheme work if the IO completion latency is a > > lot more than the 5 usecs in the testcase? What if it takes 20 usecs or > > 100 usecs or more? > > There's

Re: [PATCH v11 3/9] Avoid calling __scsi_remove_device() twice

2013-06-25 Thread Bart Van Assche
On 06/25/13 15:44, James Bottomley wrote: On Tue, 2013-06-25 at 10:37 +0200, Bart Van Assche wrote: On 06/24/13 19:38, James Bottomley wrote: On Wed, 2013-06-12 at 14:52 +0200, Bart Van Assche wrote: SCSI devices are added to the shost->__devices list from inside scsi_alloc_sdev(). If somethin

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-25 Thread Bart Van Assche
On 06/25/13 15:45, James Bottomley wrote: On Tue, 2013-06-25 at 11:01 +0200, Bart Van Assche wrote: There is a difference though between moving the EH kthread_stop() call and the patch at the start of this thread: moving the EH kthread_stop() call does not prevent that an ioctl like SG_SCSI_RESE

[PATCH 09/16] qla2xxx: Remove dead code in qla2x00_configure_hba()

2013-06-25 Thread Saurav Kashyap
From: Bart Van Assche At the end of qla2x00_configure_hba() we know that rval == QLA_SUCCESS. Hence remove the dead code. Signed-off-by: Bart Van Assche Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_dbg.c |1 + drivers/scsi/qla2xxx/qla_init.c |8 2 files changed

[PATCH 06/16] qla2xxx: Fix sparse warning from qla_mr.c and qla_iocb.c.

2013-06-25 Thread Saurav Kashyap
Signed-off-by: Giridhar Malavali Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_def.h| 34 drivers/scsi/qla2xxx/qla_gbl.h|2 +- drivers/scsi/qla2xxx/qla_inline.h |2 +- drivers/scsi/qla2xxx/qla_iocb.c |4 +- drivers/scsi/qla2xxx/qla_mr.c | 167 ++

[PATCH 04/16] qla2xxx: Do not query FC statistics during chip reset.

2013-06-25 Thread Saurav Kashyap
From: Chad Dupuis During a chip reset, the mailbox call to get FC statistics from the ISP will not work resulting in needless mailbox accesses and errors printing out: qla2xxx [:05:00.0]-00af:11: Performing ISP error recovery - ha=881fad044800. qla2xxx [:05:00.0]-1020:11: Faile

[PATCH 12/16] qla2xxx: Remove redundant assignments.

2013-06-25 Thread Saurav Kashyap
From: Bart Van Assche The value of the pointer called "nxt" is not used after the "nxt = qla24xx_copy_eft(ha, nxt)" statement. Hence keep the function call but remove the assignment. Signed-off-by: Bart Van Assche Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_dbg.c |6 +++---

[PATCH 01/16] qla2xxx: Clear the MBX_INTR_WAIT flag when the mailbox time-out happens.

2013-06-25 Thread Saurav Kashyap
From: Giridhar Malavali Signed-off-by: Giridhar Malavali Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_dbg.c |2 +- drivers/scsi/qla2xxx/qla_mbx.c | 10 -- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/ql

[PATCH 03/16] qla2xxx: Move qla2x00_free_device to the correct location.

2013-06-25 Thread Saurav Kashyap
Signed-off-by: Giridhar Malavali Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_os.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index ad72c1d..c2e2e20 100644 --- a/drivers/scsi/qla2xxx/qla_o

[PATCH 08/16] qla2xxx: Clean up qla84xx_mgmt_cmd()

2013-06-25 Thread Saurav Kashyap
From: Bart Van Assche Remove dead code, simplify a pointer computation and move the ql84_mgmt assignment to just before its first use. Signed-off-by: Bart Van Assche Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_bsg.c | 10 +- drivers/scsi/qla2xxx/qla_dbg.c |2 +- 2

[PATCH 05/16] qla2xxx: Do not take a second firmware dump when intentionally generating one.

2013-06-25 Thread Saurav Kashyap
From: Chad Dupuis When we are intentionally generating a firmware dump by executing the MBC_GEN_SYSTEM_ERROR command, the command actually times out. The normal course of action when a mailbox command times out is to take a firmware dump. However, in this special case we do not want to do this si

[PATCH 15/16] qla2xxx: Remove an unused variable from qla2x00_remove_one().

2013-06-25 Thread Saurav Kashyap
From: Bart Van Assche Signed-off-by: Bart Van Assche Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_os.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 6df5223..3e21e9f 100644 --- a/dri

[PATCH 14/16] qla2xxx: Fix qla2xxx_check_risc_status().

2013-06-25 Thread Saurav Kashyap
From: Bart Van Assche Change the 'rval' variable from QLA_FUNCTION_TIMEOUT into QLA_SUCCESS before starting a loop that is only executed if rval is initialized to QLA_SUCCESS. Coverity reported that loop as "dead code". Signed-off-by: Bart Van Assche Signed-off-by: Saurav Kashyap --- drivers/

[PATCH 11/16] qla2xxx: Remove a dead assignment in qla24xx_build_scsi_crc_2_iocbs().

2013-06-25 Thread Saurav Kashyap
From: Bart Van Assche Since the value of cur_seg is not used and since scsi_prot_sglist() has no side effects it is safe to remove the statement "cur_seg = scsi_port_sglist(cmd)". Detected by Coverity. Signed-off-by: Bart Van Assche Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_i

[PATCH 07/16] qla2xxx: Clean up qla24xx_iidma()

2013-06-25 Thread Saurav Kashyap
From: Bart Van Assche Remove dead code and simplify a pointer computation. Signed-off-by: Bart Van Assche Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_bsg.c |9 + drivers/scsi/qla2xxx/qla_dbg.c |3 ++- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git

[PATCH 16/16] qla2xxx: Fix a memory leak in an error path of qla2x00_process_els()

2013-06-25 Thread Saurav Kashyap
From: Bart Van Assche Avoid that the fcport structure gets leaked if bsg_job->request->msgcode == FC_BSG_HST_ELS_NOLOGIN, the fcport allocation succeeds and the !vha->flags.online branch is taken. This was detected by Coverity. However, Coverity does not recognize that all qla2x00_process_els() c

[PATCH 10/16] qla2xxx: Remove two superfluous tests.

2013-06-25 Thread Saurav Kashyap
From: Bart Van Assche Since ha->model_desc is an array comparing it against NULL is superfluous. Hence remove these tests. Signed-off-by: Bart Van Assche Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_gs.c |3 +-- drivers/scsi/qla2xxx/qla_os.c |3 +-- 2 files changed, 2 in

[PATCH 13/16] qla2xxx: Help Coverity with analyzing ct_sns_pkt initialization.

2013-06-25 Thread Saurav Kashyap
From: Bart Van Assche Coverity reports "Overrunning struct type ct_sns_req of 1228 bytes by passing it to a function which accesses it at byte offset 8207" for each qla2x00_prep_ct_req(), qla2x00_prep_ct_fdmi_req() and qla24xx_prep_ct_fm_req() call. Help Coverity to recognize that these calls do

MAINTAINERS: Add myself as the maintainer for BusLogic SCSI driver

2013-06-25 Thread Khalid Aziz
MAINTAINERS: Add myself as the maintainer for BusLogic SCSI driver I ported BusLogic driver to 64-bit. There is no current maintainer for this driver and since I made significant changes to the driver for 64-bit porting work, I will continue to maintain it. Signed-off-by: Khalid Aziz Cc: Khalid

[PATCH 00/16] qla2xxx: Patches for scsi "misc" branch.

2013-06-25 Thread Saurav Kashyap
Hi James, Please apply the following patches to the scsi tree at your earliest convenience for inclusion in the next mainline merge window. Thanks, ~Saurav Bart Van Assche (10): qla2xxx: Clean up qla24xx_iidma() qla2xxx: Clean up qla84xx_mgmt_cmd() qla2xxx: Remove dead code in qla2x00_con

[PATCH 02/16] qla2xxx: Set the index in outstanding command array to NULL when cmd is aborted when the request timeout.

2013-06-25 Thread Saurav Kashyap
From: Giridhar Malavali Call the generic BSG free routine to unmap the DMA buffers. Signed-off-by: Giridhar Malavali Signed-off-by: Saurav Kashyap --- drivers/scsi/qla2xxx/qla_bsg.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/d

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-25 Thread Michael Christie
On Jun 25, 2013, at 10:31 AM, Bart Van Assche wrote: > On 06/25/13 15:45, James Bottomley wrote: >> On Tue, 2013-06-25 at 11:01 +0200, Bart Van Assche wrote: >>> There is a difference though between moving the EH kthread_stop() call >>> and the patch at the start of this thread: moving the EH kt

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-25 Thread James Bottomley
On Tue, 2013-06-25 at 11:13 -0500, Michael Christie wrote: > On Jun 25, 2013, at 10:31 AM, Bart Van Assche wrote: > > > On 06/25/13 15:45, James Bottomley wrote: > >> On Tue, 2013-06-25 at 11:01 +0200, Bart Van Assche wrote: > >>> There is a difference though between moving the EH kthread_stop()

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-25 Thread Bart Van Assche
On 06/25/13 19:40, James Bottomley wrote: If I look at what we actually do: all the HBAs treat scsi_remove_host as a waited for transition. The reason this works is the loop over __scsi_remove_device() in scsi_forget_host(). By the time that loop returns, every scsi_device is gone (and so is ev

[PATCH v2 24/45] [SCSI] fcoe: Use get/put_online_cpus_atomic() to prevent CPU offline

2013-06-25 Thread Srivatsa S. Bhat
Once stop_machine() is gone from the CPU offline path, we won't be able to depend on disabling preemption to prevent CPUs from going offline from under us. Use the get/put_online_cpus_atomic() APIs to prevent CPUs from going offline, while invoking from atomic context. Cc: Robert Love Cc: "James

fcoe pull request for 3.9-rc

2013-06-25 Thread Love, Robert W
The following changes since commit 1e876e3b1a9df25bb04682b0d48aaa7e8ae1fc82: Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux (2013-06-25 09:08:07 -1000) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/rwlove/fcoe.

Re: [RFC PATCH 0/4] SG_IO filtering via sysfs and minimal whitelist

2013-06-25 Thread Paolo Bonzini
Il 27/05/2013 15:50, Paolo Bonzini ha scritto: > > We've been running in circles for nine months now. Let's restart from > the maintainer's suggestion, which was probably dismissed too quickly. > > This is still not a complete solution, because /dev/sgN does not have > access to its queue object

[PATCH 8/9] scsi/pm8001: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)

2013-06-25 Thread Yijing Wang
Pci core has been saved pm cap register offset by pdev->pm_cap in pci_pm_init() in init path. So we can use pdev->pm_cap instead of using pci_find_capability(pdev, PCI_CAP_ID_PM) for better performance and simplified code. Signed-off-by: Yijing Wang Cc: xjtu...@gmail.com Cc: lindar_...@usish.com

Re: [PATCH v2 1/1] [SCSI] sg: fix race condition when do exclusive open

2013-06-25 Thread vaughan
Hi Jörn Engel, Ping. How about this one? I found my lat patch hasn't fix the issue, so I modified it a little more. Last thread is: Subject: Re: [PATCH] sg: atomize check and set sdp->exclude in sg_open Message-ID: <20130605154106.ga2...@logfs.org> Regards, Vaughan 于 2013年06月17日 21:10, vaughan 写