From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Greg KH <gregkh@linuxfoundation.org>,
torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk,
Tom Jackson <thomas.p.jackson@intel.com>,
Dan Williams <dan.j.williams@intel.com>,
James Bottomley <JBottomley@Parallels.com>
Subject: [ 011/109] SCSI: fix eh wakeup (scsi_schedule_eh vs scsi_restart_operations)
Date: Tue, 7 Aug 2012 15:34:30 -0700 [thread overview]
Message-ID: <20120807222044.070977237@linuxfoundation.org> (raw)
In-Reply-To: <20120807222043.089735600@linuxfoundation.org>
From: Greg KH <gregkh@linuxfoundation.org>
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <dan.j.williams@intel.com>
commit 57fc2e335fd3c2f898ee73570dc81426c28dc7b4 upstream.
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.
Reported-by: Tom Jackson <thomas.p.jackson@intel.com>
Tested-by: Tom Jackson <thomas.p.jackson@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/scsi_error.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1687,6 +1687,20 @@ static void scsi_restart_operations(stru
* requests are started.
*/
scsi_run_host_queues(shost);
+
+ /*
+ * if eh is active and host_eh_scheduled is pending we need to re-run
+ * recovery. we do this check after scsi_run_host_queues() to allow
+ * everything pent up since the last eh run a chance to make forward
+ * progress before we sync again. Either we'll immediately re-run
+ * recovery or scsi_device_unbusy() will wake us again when these
+ * pending commands complete.
+ */
+ spin_lock_irqsave(shost->host_lock, flags);
+ if (shost->host_eh_scheduled)
+ if (scsi_host_set_state(shost, SHOST_RECOVERY))
+ WARN_ON(scsi_host_set_state(shost, SHOST_CANCEL_RECOVERY));
+ spin_unlock_irqrestore(shost->host_lock, flags);
}
/**
next prev parent reply other threads:[~2012-08-07 22:36 UTC|newest]
Thread overview: 116+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-07 22:34 [ 000/109] 3.4.8-stable review Greg Kroah-Hartman
2012-08-07 22:34 ` [ 001/109] target: Add generation of LOGICAL BLOCK ADDRESS OUT OF RANGE Greg Kroah-Hartman
2012-08-07 22:34 ` [ 002/109] iscsi-target: Drop bogus struct file usage for iSCSI/SCTP Greg Kroah-Hartman
2012-08-07 22:34 ` [ 003/109] mmc: sdhci-pci: CaFe has broken card detection Greg Kroah-Hartman
2012-08-07 22:34 ` [ 004/109] mmc: sdhci: fix incorrect command used in tuning Greg Kroah-Hartman
2012-08-07 22:34 ` [ 005/109] powerpc/ftrace: Fix assembly trampoline register usage Greg Kroah-Hartman
2012-08-07 22:34 ` [ 006/109] powerpc: Add "memory" attribute for mfmsr() Greg Kroah-Hartman
2012-08-07 22:34 ` [ 007/109] powerpc/eeh: Check handle_eeh_events() return value Greg Kroah-Hartman
2012-08-07 22:34 ` [ 008/109] powerpc/85xx: use the BRx registers to enable indirect mode on the P1022DS Greg Kroah-Hartman
2012-08-07 22:34 ` [ 009/109] SCSI: libsas: continue revalidation Greg Kroah-Hartman
2012-08-07 22:34 ` [ 010/109] SCSI: libsas: fix sas_discover_devices return code handling Greg Kroah-Hartman
2012-08-07 22:34 ` Greg Kroah-Hartman [this message]
2012-08-07 22:34 ` [ 012/109] SCSI: fix hot unplug vs async scan race Greg Kroah-Hartman
2012-08-07 22:34 ` [ 013/109] SCSI: Fix device removal NULL pointer dereference Greg Kroah-Hartman
2012-08-07 22:34 ` [ 014/109] SCSI: Avoid dangling pointer in scsi_requeue_command() Greg Kroah-Hartman
2012-08-07 22:34 ` [ 015/109] rt2800usb: 2001:3c17 is an RT3370 device Greg Kroah-Hartman
2012-08-07 22:34 ` [ 016/109] ARM: OMAP2+: OPP: Fix to ensure check of right oppdef after bad one Greg Kroah-Hartman
2012-08-07 22:34 ` [ 017/109] ASoC: dapm: Fix locking during codec shutdown Greg Kroah-Hartman
2012-08-08 21:13 ` Herton Ronaldo Krzesinski
2012-08-09 10:08 ` Mark Brown
2012-08-09 15:18 ` Greg Kroah-Hartman
2012-08-07 22:34 ` [ 018/109] ASoC: dapm: Fix _PRE and _POST events for DAPM performance improvements Greg Kroah-Hartman
2012-08-07 22:34 ` [ 019/109] ASoC: wm8962: Redo early init of the part on resume Greg Kroah-Hartman
2012-08-07 22:34 ` [ 020/109] ALSA: hda - Add support for Realtek ALC282 Greg Kroah-Hartman
2012-08-07 22:34 ` [ 021/109] ALSA: hda - Turn on PIN_OUT from hdmi playback prepare Greg Kroah-Hartman
2012-08-07 22:34 ` [ 022/109] usbdevfs: Correct amount of data copied to user in processcompl_compat Greg Kroah-Hartman
2012-08-07 22:34 ` [ 023/109] usb: gadget: Fix g_ether interface link status Greg Kroah-Hartman
2012-08-07 22:34 ` [ 024/109] USB: option: add ZTE MF821D Greg Kroah-Hartman
2012-08-07 22:34 ` [ 025/109] Revert "usb/uas: make sure data urb is gone if we receive status before that" Greg Kroah-Hartman
2012-08-07 22:34 ` [ 026/109] ALSA: hda - add dock support for Thinkpad X230 Tablet Greg Kroah-Hartman
2012-08-07 22:34 ` [ 027/109] x86/mce: Fix siginfo_t->si_addr value for non-recoverable memory faults Greg Kroah-Hartman
2012-08-07 22:34 ` [ 028/109] locks: fix checking of fcntl_setlease argument Greg Kroah-Hartman
2012-08-07 22:34 ` [ 029/109] batman-adv: fix skb->data assignment Greg Kroah-Hartman
2012-08-09 1:53 ` Ben Hutchings
2012-08-09 15:17 ` Greg Kroah-Hartman
2012-08-07 22:34 ` [ 030/109] ftrace: Disable function tracing during suspend/resume and hibernation, again Greg Kroah-Hartman
2012-08-07 22:34 ` [ 031/109] PM / Sleep: call early resume handlers when suspend_noirq fails Greg Kroah-Hartman
2012-08-07 22:34 ` [ 032/109] TPM: chip disabled state erronously being reported as error Greg Kroah-Hartman
2012-08-07 22:34 ` [ 033/109] tun: fix a crash bug and a memory leak Greg Kroah-Hartman
2012-08-07 22:34 ` [ 034/109] mac80211: fail authentication when AP denied authentication Greg Kroah-Hartman
2012-08-07 22:34 ` [ 035/109] iwlwifi: fix debug print in iwl_sta_calc_ht_flags Greg Kroah-Hartman
2012-08-07 22:34 ` [ 036/109] rtlwifi: rtl8192cu: Change buffer allocation for synchronous reads Greg Kroah-Hartman
2012-08-07 22:34 ` [ 037/109] rtlwifi: rtl8192de: Fix phy-based version calculation Greg Kroah-Hartman
2012-08-07 22:34 ` [ 038/109] mwifiex: correction in mcs index check Greg Kroah-Hartman
2012-08-07 22:34 ` [ 039/109] s390/idle: fix sequence handling vs cpu hotplug Greg Kroah-Hartman
2012-08-07 22:34 ` [ 040/109] s390/mm: downgrade page table after fork of a 31 bit process Greg Kroah-Hartman
2012-08-07 22:35 ` [ 041/109] s390/mm: fix fault handling for page table walk case Greg Kroah-Hartman
2012-08-07 22:35 ` [ 042/109] iommu/amd: Add missing spin_lock initialization Greg Kroah-Hartman
2012-08-07 22:35 ` [ 043/109] iommu/amd: Fix hotplug with iommu=pt Greg Kroah-Hartman
2012-08-07 22:35 ` [ 044/109] udf: Improve table length check to avoid possible overflow Greg Kroah-Hartman
2012-08-07 22:35 ` [ 045/109] stable: update references to older 2.6 versions for 3.x Greg Kroah-Hartman
2012-08-07 22:35 ` [ 046/109] staging: zsmalloc: Finish conversion to a separate module Greg Kroah-Hartman
2012-08-07 22:35 ` [ 047/109] workqueue: perform cpu down operations from low priority cpu_notifier() Greg Kroah-Hartman
2012-08-07 22:35 ` [ 048/109] ACPI, APEI: Fixup common access width firmware bug Greg Kroah-Hartman
2012-08-07 22:35 ` [ 049/109] ACPI/AC: prevent OOPS on some boxes due to missing check power_supply_register() return value check Greg Kroah-Hartman
2012-08-07 22:35 ` [ 050/109] Btrfs: call the ordered free operation without any locks held Greg Kroah-Hartman
2012-08-07 22:35 ` [ 051/109] cifs: reinstate sec=ntlmv2 mount option Greg Kroah-Hartman
2012-08-07 22:35 ` [ 052/109] spi/pl022: disable port when unused Greg Kroah-Hartman
2012-08-07 22:35 ` [ 053/109] qeth: repair crash in qeth_l3_vlan_rx_kill_vid() Greg Kroah-Hartman
2012-08-07 22:35 ` [ 054/109] tg3: add device id of Apple Thunderbolt Ethernet device Greg Kroah-Hartman
2012-08-07 22:35 ` [ 055/109] tg3: Fix Read DMA workaround for 5719 A0 Greg Kroah-Hartman
2012-08-10 2:21 ` Ben Hutchings
2012-08-07 22:35 ` [ 056/109] tg3: Fix race condition in tg3_get_stats64() Greg Kroah-Hartman
2012-08-07 22:35 ` [ 057/109] drm/radeon: fix fence related segfault in CS Greg Kroah-Hartman
2012-08-07 22:35 ` [ 058/109] drm/radeon: fix bo creation retry path Greg Kroah-Hartman
2012-08-07 22:35 ` [ 059/109] drm/radeon: Try harder to avoid HW cursor ending on a multiple of 128 columns Greg Kroah-Hartman
2012-08-07 22:35 ` [ 060/109] drm/radeon: fix non revealent error message Greg Kroah-Hartman
2012-08-07 22:35 ` [ 061/109] drm/radeon: fix hotplug of DP to DVI|HDMI passive adapters (v2) Greg Kroah-Hartman
2012-08-07 22:35 ` [ 062/109] drm/radeon: on hotplug force link training to happen (v2) Greg Kroah-Hartman
2012-08-07 22:35 ` [ 063/109] drm/radeon: fix dpms on/off on trinity/aruba v2 Greg Kroah-Hartman
2012-08-07 22:35 ` [ 064/109] posix_types.h: Cleanup stale __NFDBITS and related definitions Greg Kroah-Hartman
2012-08-07 22:35 ` [ 065/109] dm thin: reduce endio_hook pool size Greg Kroah-Hartman
2012-08-07 22:35 ` [ 066/109] dm thin: fix memory leak in process_prepared_mapping error paths Greg Kroah-Hartman
2012-08-07 22:35 ` [ 067/109] pnfs-obj: Fix __r4w_get_page when offset is beyond i_size Greg Kroah-Hartman
2012-08-07 22:35 ` [ 068/109] nfsd4: our filesystems are normally case sensitive Greg Kroah-Hartman
2012-08-07 22:35 ` [ 069/109] nfs: skip commit in releasepage if were freeing memory for fs-related reasons Greg Kroah-Hartman
2012-08-07 22:35 ` [ 070/109] NFS: Fix a number of bugs in the idmapper Greg Kroah-Hartman
2012-08-07 22:35 ` [ 071/109] nouveau: Fix alignment requirements on src and dst addresses Greg Kroah-Hartman
2012-08-07 22:35 ` [ 072/109] ext4: pass a char * to ext4_count_free() instead of a buffer_head ptr Greg Kroah-Hartman
2012-08-07 22:35 ` [ 073/109] ext4: fix overhead calculation used by ext4_statfs() Greg Kroah-Hartman
2012-08-07 22:35 ` [ 074/109] ext4: fix hole punch failure when depth is greater than 0 Greg Kroah-Hartman
2012-08-07 22:35 ` [ 075/109] ext4: dont let i_reserved_meta_blocks go negative Greg Kroah-Hartman
2012-08-07 22:35 ` [ 076/109] ext4: undo ext4_calc_metadata_amount if we fail to claim space Greg Kroah-Hartman
2012-08-07 22:35 ` [ 077/109] atl1c: fix issue of transmit queue 0 timed out Greg Kroah-Hartman
2012-08-07 22:35 ` [ 078/109] netem: add limitation to reordered packets Greg Kroah-Hartman
2012-08-07 22:35 ` [ 079/109] gianfar: fix potential sk_wmem_alloc imbalance Greg Kroah-Hartman
2012-08-07 22:35 ` [ 080/109] net: Fix memory leak - vlan_info struct Greg Kroah-Hartman
2012-08-07 22:35 ` [ 081/109] bnx2: Fix bug in bnx2_free_tx_skbs() Greg Kroah-Hartman
2012-08-07 22:35 ` [ 082/109] sch_sfb: Fix missing NULL check Greg Kroah-Hartman
2012-08-07 22:35 ` [ 083/109] sctp: Fix list corruption resulting from freeing an association on a list Greg Kroah-Hartman
2012-08-07 22:35 ` [ 084/109] caif: Fix access to freed pernet memory Greg Kroah-Hartman
2012-08-07 22:35 ` [ 085/109] cipso: dont follow a NULL pointer when setsockopt() is called Greg Kroah-Hartman
2012-08-07 22:35 ` [ 086/109] net: Fix references to out-of-scope variables in put_cmsg_compat() Greg Kroah-Hartman
2012-08-07 22:35 ` [ 087/109] r8169: revert "add byte queue limit support" Greg Kroah-Hartman
2012-08-07 22:35 ` [ 088/109] caif: fix NULL pointer check Greg Kroah-Hartman
2012-08-07 22:35 ` [ 089/109] wanmain: comparing array with NULL Greg Kroah-Hartman
2012-08-07 22:35 ` [ 090/109] tcp: Add TCP_USER_TIMEOUT negative value check Greg Kroah-Hartman
2012-08-07 22:35 ` [ 091/109] USB: kaweth.c: use GFP_ATOMIC under spin_lock Greg Kroah-Hartman
2012-08-07 22:35 ` [ 092/109] net: fix rtnetlink IFF_PROMISC and IFF_ALLMULTI handling Greg Kroah-Hartman
2012-08-07 22:35 ` [ 093/109] tcp: perform DMA to userspace only if there is a task waiting for it Greg Kroah-Hartman
2012-08-07 22:35 ` [ 094/109] net/tun: fix ioctl() based info leaks Greg Kroah-Hartman
2012-08-07 22:35 ` [ 095/109] USB: echi-dbgp: increase the controller wait time to come out of halt Greg Kroah-Hartman
2012-08-07 22:35 ` [ 096/109] ALSA: snd-usb: fix clock source validity index Greg Kroah-Hartman
2012-08-07 22:35 ` [ 097/109] ALSA: mpu401: Fix missing initialization of irq field Greg Kroah-Hartman
2012-08-07 22:35 ` [ 098/109] ALSA: hda - Fix invalid D3 of headphone DAC on VT202x codecs Greg Kroah-Hartman
2012-08-07 22:35 ` [ 099/109] ALSA: hda - Fix mute-LED GPIO setup for HP Mini 210 Greg Kroah-Hartman
2012-08-07 22:35 ` [ 100/109] ALSA: hda - Fix polarity of mute LED on " Greg Kroah-Hartman
2012-08-07 22:36 ` [ 101/109] ALSA: hda - Fix mute-LED GPIO initialization for IDT codecs Greg Kroah-Hartman
2012-08-07 22:36 ` [ 102/109] ALSA: hda - Support dock on Lenovo Thinkpad T530 with ALC269VC Greg Kroah-Hartman
2012-08-07 22:36 ` [ 103/109] ASoC: wm8962: Allow VMID time to fully ramp Greg Kroah-Hartman
2012-08-07 22:36 ` [ 104/109] ASoC: wm8994: Ensure there are enough BCLKs for four channels Greg Kroah-Hartman
2012-08-07 22:36 ` [ 105/109] m68k: Make sys_atomic_cmpxchg_32 work on classic m68k Greg Kroah-Hartman
2012-08-07 22:36 ` [ 106/109] m68k: Correct the Atari ALLOWINT definition Greg Kroah-Hartman
2012-08-07 22:36 ` [ 107/109] futex: Test for pi_mutex on fault in futex_wait_requeue_pi() Greg Kroah-Hartman
2012-08-07 22:36 ` [ 108/109] futex: Fix bug in WARN_ON for NULL q.pi_state Greg Kroah-Hartman
2012-08-07 22:36 ` [ 109/109] futex: Forbid uaddr == uaddr2 in futex_wait_requeue_pi() Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120807222044.070977237@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=JBottomley@Parallels.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=dan.j.williams@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=thomas.p.jackson@intel.com \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).