- 20 7月, 2012 40 次提交
-
-
由 Cong Meng 提交于
This patch implements the hotplug support for virtio-scsi. When there is a device attached/detached, the virtio-scsi driver will be signaled via event virtual queue and it will add/remove the scsi device in question automatically. Signed-off-by: NSen Wang <senwang@linux.vnet.ibm.com> Signed-off-by: NCong Meng <mc@linux.vnet.ibm.com> Acked-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Paolo Bonzini 提交于
To improve performance for I/O to different targets, add a separate scatterlist for each of them. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Paolo Bonzini 提交于
We do not need the sglist after calling virtqueue_add_buf. Hence we can "pipeline" the locked operations and start preparing the sglist for the next request while we kick the virtqueue. Together with the previous two patches, this improves performance as follows. For a simple "if=/dev/sda of=/dev/null bs=128M iflag=direct" (the source being a 10G disk, residing entirely in the host buffer cache), the additional locking does not cause any penalty with only one dd process, but 2 simultaneous I/O operations improve their times by 3%: number of simultaneous dd 1 2 ---------------------------------------- current 5.9958s 10.2640s patched 5.9531s 9.8663s (Times are best of 10). Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Paolo Bonzini 提交于
Keep a separate lock for each virtqueue. While not particularly important now, it prepares the code for when we will add support for multiple request queues. It is also more tidy as soon as we introduce a separate lock for the sglist. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Paolo Bonzini 提交于
Separate virtqueue_kick_prepare from virtqueue_notify, so that the expensive vmexit is done without holding the lock. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Yi Zou 提交于
This is exposed in the case the FCP_DATA frames somehow got lost and fc_fcp got the FCP_RSP, in fc_fcp_recv_resp(), since xfer_len is less than the expected_len it resets the the timer to wait to 2 more jiffies in case the data frames are already queued locally. However, for target does not support REC, it would just send RJT w/ ELS_RJT_UNSUP. The rec response handler thus only clears the rport flag for not doing REC later, but does not do fcp_io_complete() on the associated fsp. The fix is just check status of FCP_RSP being received already, i.e. using the FC_SRB_RCV_STATUS flag, in fc_fcp_timeout before start sending REC. We should have waited long enough if there is truely data frames queued locally. Signed-off-by: NYi Zou <yi.zou@intel.com> Tested-by: NRoss Brattain <ross.b.brattain@intel.com> Signed-off-by: NRobert Love <robert.w.love@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Vasu Dev 提交于
The FC-GS-3 sepc requires to wait for least 3 times R_A_TOV per sec 4.6.1 "If the Requesting_CT does not receive a Response CT_IU from the Responding_CT within three times R_A_TOV, it shall consider this to be a protocol error." This means added four new states with management server could add significant delay with multiple retries on default 12 second timeout(3 * R_A_TOV), so instead just skip these states on very first timeout on any of these states to not stuck with states for such longer period. Signed-off-by: NVasu Dev <vasu.dev@intel.com> Tested-by: NMarcus Dennis <marcusx.e.dennis@intel.com> Signed-off-by: NRobert Love <robert.w.love@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Yi Zou 提交于
The lport_recv(), i.e., fc_lport_recv_req() may get called w/o the sequence ptr being set in fr_seq(), particularly in the case of vn2vn mode, this may happen if the passive fcp provider, e.g., tcm_fc, has not been registered yet. Signed-off-by: NYi Zou <yi.zou@intel.com> Tested-by: NRoss Brattain <ross.b.brattain@intel.com> Signed-off-by: NRobert Love <robert.w.love@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Neil Horman 提交于
Noticed that we can shuffle the code around in fcoe_percpu_receive_thread a bit and avoid taking the fcoe_rx_list lock twice per iteration. This should improve throughput somewhat. With this change we take the lock, and check for new frames in a single critical section. Only if the list is empty do we drop the lock and re-acquire it after being signaled to wake up. Change Notes: v2) did some further cleanup on the patch by replacing the 2nd call of spin_lock/splice_init with a goto to the top of the outer loop. This allows me to change the inner while loop to an if conditional and remove the sencond check of kthread_should_stop. Based on suggestion from Vasu Dev. Signed-off-by: NNeil Horman <nhorman@tuxdriver.com> Acked-by: NVasu Dev <vasu.dev@intel.com> Signed-off-by: NRobert Love <robert.w.love@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Robert Love 提交于
strtoul returns an 'unsigned long' so there is no reason to check if the value is less than zero. strtoul already checks for the '-' character deep in its bowels. It will return an error if the user has provided a negative value and fcoe_str_to_dev_loss will return that error to its caller. This patch fixes the following Coverity reported warning: CID 703581 - NO_EFFECT Unsigned compared against 0 - This less-than-zero comparison of an unsigned value is never true. "*val < 0UL". drivers/scsi/fcoe/fcoe_sysfs.c:105 Signed-off-by: NRobert Love <robert.w.love@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Vasu Dev 提交于
Add exch timeout info to have debug log with exch timeout value to match with retries, also add debug info on exch timer cancel. Added common fc_exch_timer_cancel() func and grouped this along with fc_exch_timer_set() function, so that added debug code is not repeated. Signed-off-by: NVasu Dev <vasu.dev@intel.com> Signed-off-by: NRobert Love <robert.w.love@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Lin Ming 提交于
There is a race in scsi_bus_resume_common when set device's runtime state to active after pm_runtime_put_sync(dev->parent). Parent device may have been suspended so pm_runtime_set_active(dev) will fail with -EBUSY. Signed-off-by: NLin Ming <ming.m.lin@intel.com> Acked-by: NAlan Stern <stern@rowland.harvard.edu> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 James Bottomley 提交于
Commit d38bd3aef ("Add -Werror compilation flag") is causing build breakage with random gcc incarnations. These look like gcc problems, but we shouldn't break the build because of a bad gcc. Fix this by adding a make flag WARNINGS_BECOME_ERRORS=1 which is the same as aic7xxx uses so ordinarily the build doesn't use -Werror Reported-by: NFengguang Wu <fengguang.wu@intel.com> Cc: Alex Iannicelli <alex.iannicelli@emulex.com> Cc: James Smart <james.smart@emulex.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Dan Carpenter 提交于
We don't use "dev" any more after 07ec747a5f ("libsas: remove ata_port.lock management duties from lldds") and it causes a compile warning. Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Cc: Xiangliang Yu <yuxiangl@marvell.com> Signed-off-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Dan Williams 提交于
The timer and the completion are only used for slow path tasks (smp, and lldd tmfs), yet we incur the allocation space and cpu setup time for every fast path task. Cc: Xiangliang Yu <yuxiangl@marvell.com> Acked-by: NJack Wang <jack_wang@usish.com> Signed-off-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Dan Williams 提交于
On the way to add a new sata_device field, noticed that libsas is carrying port multiplier infrastructure that is explicitly disabled by sas_discover_sata(). The aic94xx touches the unused port_no, so leave that field in case there was some use for it. Signed-off-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Dan Williams 提交于
commit 198439e4 [SCSI] libsas: do not set res = 0 in sas_ex_discover_dev() commit 19252de6 [SCSI] libsas: fix wide port hotplug issues The above commits seem to have confused the return value of sas_ex_discover_dev which is non-zero on failure and sas_ex_join_wide_port which just indicates short circuiting discovery on already established ports. The result is random discovery failures depending on configuration. Calls to sas_ex_join_wide_port are the source of the trouble as its return value is errantly assigned to 'res'. Convert it to bool and stop returning its result up the stack. Cc: <stable@vger.kernel.org> Tested-by: NDan Melnic <dan.melnic@amd.com> Reported-by: NDan Melnic <dan.melnic@amd.com> Signed-off-by: NDan Williams <dan.j.williams@intel.com> Reviewed-by: NJack Wang <jack_wang@usish.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Dan Williams 提交于
Continue running revalidation until no more broadcast devices are discovered. Fixes cases where re-discovery completes too early in a domain with multiple expanders with pending re-discovery events. Servicing BCNs can get backed up behind error recovery. Cc: <stable@vger.kernel.org> Signed-off-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Jeff Skirvin 提交于
The discovery function "sas_rediscover_dev" had two bugs: 1) it did not pay attention to the return status from the SMP task execution; 2) the stack variable used for the returned SAS address was compared against 0 without being initialized. Signed-off-by: NJeff Skirvin <jeffrey.d.skirvin@intel.com> Signed-off-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Dan Williams 提交于
...now that the strategy handlers guarantee eh context and notify the driver of bus reset. Signed-off-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Dan Williams 提交于
sas_eh_bus_reset_handler() amounts to sas_phy_reset() without notification of the reset to the lldd. If this is triggered from eh-cmnd recovery there may be sas_tasks for the lldd to terminate, so ->lldd_I_T_nexus_reset is warranted. Cc: Xiangliang Yu <yuxiangl@marvell.com> Cc: Luben Tuikov <ltuikov@yahoo.com> Cc: Jack Wang <jack_wang@usish.com> Reviewed-by: NJacek Danecki <jacek.danecki@intel.com> [jacek: modify pm8001_I_T_nexus_reset to return -ENODEV] Signed-off-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Dan Williams 提交于
When recovering failed eh-cmnds let the lldd attempt an abort via scsi_abort_eh_cmnd before escalating. Reviewed-by: NJacek Danecki <jacek.danecki@intel.com> Signed-off-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Dan Williams 提交于
The strategy handlers may be called in places that are problematic for libsas (i.e. sata resets outside of domain revalidation filtering / libata link recovery), or problematic for userspace (non-blocking ioctl to sleeping reset functions). However, these routines are also called for eh escalations and recovery of scsi_eh_prep_cmnd(), so permit them as long as we are running in the host's error handler, otherwise arrange for them to be triggered in eh_context. Signed-off-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Dan Williams 提交于
A quick reading of scsi_error_handler() one could come away with the impression that it does its wakeup event check while the task state is TASK_RUNNING. In fact it sets TASK_INTERRUPTIBLE at the bottom of the loop, but that is ~50 lines down. Just set TASK_INTERRUPTIBLE at the top of loop and be done. Signed-off-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Maciej Trela 提交于
eh is woken up automatically by the presence of failed commands, scsi_schedule_eh is reserved for cases where there are no failed commands. This guarantees that host_eh_sceduled is only incremented when an explicit eh request is made. Reviewed-by: NJacek Danecki <jacek.danecki@intel.com> Signed-off-by: NMaciej Trela <maciej.trela@intel.com> [fixed spurious delete of sas_ata_task_abort] Signed-off-by: NArtur Wojcik <artur.wojcik@intel.com> Signed-off-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Dan Williams 提交于
Rapid ata hotplug on a libsas controller results in cases where libsas is waiting indefinitely on eh to perform an ata probe. A race exists between scsi_schedule_eh() and scsi_restart_operations() in the case when scsi_restart_operations() issues i/o to other devices in the sas domain. When this happens the host state transitions from SHOST_RECOVERY (set by scsi_schedule_eh) back to SHOST_RUNNING and ->host_busy is non-zero so we put the eh thread to sleep even though ->host_eh_scheduled is active. Before putting the error handler to sleep we need to check if the host_state needs to return to SHOST_RECOVERY for another trip through eh. Since i/o that is released by scsi_restart_operations has been blocked for at least one eh cycle, this implementation allows those i/o's to run before another eh cycle starts to discourage hung task timeouts. Cc: <stable@vger.kernel.org> Reported-by: NTom Jackson <thomas.p.jackson@intel.com> Tested-by: NTom Jackson <thomas.p.jackson@intel.com> Signed-off-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Dan Williams 提交于
When managing shost->host_eh_scheduled libata assumes that there is a 1:1 shost-to-ata_port relationship. libsas creates a 1:N relationship so it needs to manage host_eh_scheduled cumulatively at the host level. The sched_eh and end_eh port port ops allow libsas to track when domain devices enter/leave the "eh-pending" state under ha->lock (previously named ha->state_lock, but it is no longer just a lock for ha->state changes). Since host_eh_scheduled indicates eh without backing commands pinning the device it can be deallocated at any time. Move the taking of the domain_device reference under the port_lock to guarantee that the ata_port stays around for the duration of eh. Reviewed-by: NJacek Danecki <jacek.danecki@intel.com> Acked-by: NJeff Garzik <jgarzik@redhat.com> Signed-off-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Dan Williams 提交于
The following crash results from cases where the end_device has been removed before scsi_sysfs_add_sdev has had a chance to run. BUG: unable to handle kernel NULL pointer dereference at 0000000000000098 IP: [<ffffffff8115e100>] sysfs_create_dir+0x32/0xb6 ... Call Trace: [<ffffffff8125e4a8>] kobject_add_internal+0x120/0x1e3 [<ffffffff81075149>] ? trace_hardirqs_on+0xd/0xf [<ffffffff8125e641>] kobject_add_varg+0x41/0x50 [<ffffffff8125e70b>] kobject_add+0x64/0x66 [<ffffffff8131122b>] device_add+0x12d/0x63a [<ffffffff814b65ea>] ? _raw_spin_unlock_irqrestore+0x47/0x56 [<ffffffff8107de15>] ? module_refcount+0x89/0xa0 [<ffffffff8132f348>] scsi_sysfs_add_sdev+0x4e/0x28a [<ffffffff8132dcbb>] do_scan_async+0x9c/0x145 ...teach scsi_sysfs_add_devices() to check for deleted devices() before trying to add them, and teach scsi_remove_target() how to remove targets that have not been added via device_add(). Cc: <stable@vger.kernel.org> Reported-by: NDariusz Majchrzak <dariusz.majchrzak@intel.com> Signed-off-by: NDan Williams <dan.j.williams@intel.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Ben Collins 提交于
This may not fix all endian issues in this driver, but it does get the driver working on PowerPC for a PMC SRC card. So it should at least fix all the problems in the core and in the SRC support. [jejb: fix >> 32 breakage reported by Fengguang Wu] Signed-off-by: NBen Collins <bcollins@ubuntu.com> Acked-by: NAchim Leubner <Achim_Leubner@pmc-sierra.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Ben Collins 提交于
The loop that waited for syncronous fib commands was causing a CPU stall when a timeout actually occured. 1) Switch to using a more accurate timeout mechanism. 2) Do not pace the loop with udelay(). Use cpu_relax() to allow for scheduling to occur. Signed-off-by: NBen Collins <bcollins@ubuntu.com> Acked-by: NAchim Leubner <Achim_Leubner@pmc-sierra.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Ben Collins 提交于
When an error occured that would shut down the driver, some in-flight events were getting caught up, deadlocking a CPU or two. Signed-off-by: NBen Collins <bcollins@ubuntu.com> Acked-by: NAchim Leubner <Achim_Leubner@pmc-sierra.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Ben Collins 提交于
This also stops using the "legacy crap" in Scsi_Host (shost->base is an unsigned long). This affected 32-bit systems that have 64-bit resource sizes, causing the IO address to be truncated. Signed-off-by: NBen Collins <bcollins@ubuntu.com> Acked-by: NAchim Leubner <Achim_Leubner@pmc-sierra.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Mike Snitzer 提交于
Introduce scsi_dh_attached_handler_name() to retrieve the name of the scsi_dh that is attached to the scsi_device associated with the provided request queue. Returns NULL if a scsi_dh is not attached. Also, fix scsi_dh_{attach,detach} function header comments to document @q rather than @sdev. Signed-off-by: NMike Snitzer <snitzer@redhat.com> Tested-by: NBabu Moger <babu.moger@netapp.com> Reviewed-by: NChandra Seetharaman <sekharan@us.ibm.com> Acked-by: NHannes Reinecke <hare@suse.de> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Karen Xie 提交于
Fixed the parentheses so the tcp push bit would be sent properly. Signed-off-by: NKaren Xie <kxie@chelsio.com> Reviewed-by: NMike Christie <michaelc@cs.wisc.edu> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Bart Van Assche 提交于
Avoid that the code for requeueing SCSI requests triggers a crash by making sure that that code isn't scheduled anymore after a device has been removed. Also, source code inspection of __scsi_remove_device() revealed a race condition in this function: no new SCSI requests must be accepted for a SCSI device after device removal started. Signed-off-by: NBart Van Assche <bvanassche@acm.org> Reviewed-by: NMike Christie <michaelc@cs.wisc.edu> Acked-by: NTejun Heo <tj@kernel.org> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Bart Van Assche 提交于
The return value of scsi_queue_insert() is ignored by all its callers, hence change the return type of this function into void. Signed-off-by: NBart Van Assche <bvanassche@acm.org> Reviewed-by: NMike Christie <michaelc@cs.wisc.edu> Reviewed-by: NTejun Heo <tj@kernel.org> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Bart Van Assche 提交于
When we call scsi_unprep_request() the command associated with the request gets destroyed and therefore drops its reference on the device. If this was the only reference, the device may get released and we end up with a NULL pointer deref when we call blk_requeue_request. Reported-by: NMike Christie <michaelc@cs.wisc.edu> Signed-off-by: NBart Van Assche <bvanassche@acm.org> Reviewed-by: NMike Christie <michaelc@cs.wisc.edu> Reviewed-by: NTejun Heo <tj@kernel.org> Cc: <stable@kernel.org> [jejb: enhance commend and add commit log for stable] Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Bart Van Assche 提交于
Use blk_queue_dead() to test whether the queue is dead instead of !sdev. Since scsi_prep_fn() may be invoked concurrently with __scsi_remove_device(), keep the queuedata (sdev) pointer in __scsi_remove_device(). This patch fixes a kernel oops that can be triggered by USB device removal. See also http://www.spinics.net/lists/linux-scsi/msg56254.html. Other changes included in this patch: - Swap the blk_cleanup_queue() and kfree() calls in scsi_host_dev_release() to make that code easier to grasp. - Remove the queue dead check from scsi_run_queue() since the queue state can change anyway at any point in that function where the queue lock is not held. - Remove the queue dead check from the start of scsi_request_fn() since it is redundant with the scsi_device_online() check. Reported-by: NJun'ichi Nomura <j-nomura@ce.jp.nec.com> Signed-off-by: NBart Van Assche <bvanassche@acm.org> Reviewed-by: NMike Christie <michaelc@cs.wisc.edu> Reviewed-by: NTejun Heo <tj@kernel.org> Cc: <stable@kernel.org> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Muthukumar Ratty 提交于
If the queue is dead blk_execute_rq_nowait() doesn't invoke the done() callback function. That will result in blk_execute_rq() being stuck in wait_for_completion(). Avoid this by initializing rq->end_io to the done() callback before we check the queue state. Also, make sure the queue lock is held around the invocation of the done() callback. Found this through source code review. Signed-off-by: NMuthukumar Ratty <muthur@gmail.com> Signed-off-by: NBart Van Assche <bvanassche@acm.org> Reviewed-by: NTejun Heo <tj@kernel.org> Acked-by: NJens Axboe <axboe@kernel.dk> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-
由 Dan Carpenter 提交于
We took this lock with spin_lock() so we should unlock it with spin_unlock() instead of spin_unlock_irq(). This was introduced in f2c8dc40 "[SCSI] megaraid_mbox: remove scsi_assign_lock usage". Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Acked-by: NAdam Radford <aradford@gmail.com> Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
-