public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	Tejun Heo <tj@kernel.org>
Subject: [ 075/127] sata_rcar: fix interrupt handling
Date: Wed,  5 Jun 2013 14:34:02 -0700	[thread overview]
Message-ID: <20130605213226.451713988@linuxfoundation.org> (raw)
In-Reply-To: <20130605213217.966891866@linuxfoundation.org>

3.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

commit 52a2a1087b5924de00484f35ef5e2a73f61dbd22 upstream.

The driver's interrupt handling code is too picky in deciding whether it should
handle an interrupt or not which causes completely unneeded spurious interrupts.
Thus make sata_rcar_{ata|serr}_interrupt() *void*; add ATA status register read
to sata_rcar_ata_interrupt() to clear an unexpected ATA interrupt -- it doesn't
get cleared by writing to the SATAINTSTAT register in the interrupt mode we use.

Also, in sata_rcar_ata_interrupt() we should check SATAINTSTAT register only for
enabled interrupts and we should clear  only those interrupts  that we have read
as active first time around, because else we have  a  race and risk clearing  an
interrupt that  can  occur between read  and write of the  SATAINTSTAT  register
and never registering it...

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/ata/sata_rcar.c |   23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -618,17 +618,16 @@ static struct ata_port_operations sata_r
 	.bmdma_status		= sata_rcar_bmdma_status,
 };
 
-static int sata_rcar_serr_interrupt(struct ata_port *ap)
+static void sata_rcar_serr_interrupt(struct ata_port *ap)
 {
 	struct sata_rcar_priv *priv = ap->host->private_data;
 	struct ata_eh_info *ehi = &ap->link.eh_info;
 	int freeze = 0;
-	int handled = 0;
 	u32 serror;
 
 	serror = ioread32(priv->base + SCRSERR_REG);
 	if (!serror)
-		return 0;
+		return;
 
 	DPRINTK("SError @host_intr: 0x%x\n", serror);
 
@@ -641,7 +640,6 @@ static int sata_rcar_serr_interrupt(stru
 		ata_ehi_push_desc(ehi, "%s", "hotplug");
 
 		freeze = serror & SERR_COMM_WAKE ? 0 : 1;
-		handled = 1;
 	}
 
 	/* freeze or abort */
@@ -649,11 +647,9 @@ static int sata_rcar_serr_interrupt(stru
 		ata_port_freeze(ap);
 	else
 		ata_port_abort(ap);
-
-	return handled;
 }
 
-static int sata_rcar_ata_interrupt(struct ata_port *ap)
+static void sata_rcar_ata_interrupt(struct ata_port *ap)
 {
 	struct ata_queued_cmd *qc;
 	int handled = 0;
@@ -662,7 +658,9 @@ static int sata_rcar_ata_interrupt(struc
 	if (qc)
 		handled |= ata_bmdma_port_intr(ap, qc);
 
-	return handled;
+	/* be sure to clear ATA interrupt */
+	if (!handled)
+		sata_rcar_check_status(ap);
 }
 
 static irqreturn_t sata_rcar_interrupt(int irq, void *dev_instance)
@@ -677,20 +675,21 @@ static irqreturn_t sata_rcar_interrupt(i
 	spin_lock_irqsave(&host->lock, flags);
 
 	sataintstat = ioread32(priv->base + SATAINTSTAT_REG);
+	sataintstat &= SATA_RCAR_INT_MASK;
 	if (!sataintstat)
 		goto done;
 	/* ack */
-	iowrite32(sataintstat & ~SATA_RCAR_INT_MASK,
-		 priv->base + SATAINTSTAT_REG);
+	iowrite32(~sataintstat & 0x7ff, priv->base + SATAINTSTAT_REG);
 
 	ap = host->ports[0];
 
 	if (sataintstat & SATAINTSTAT_ATA)
-		handled |= sata_rcar_ata_interrupt(ap);
+		sata_rcar_ata_interrupt(ap);
 
 	if (sataintstat & SATAINTSTAT_SERR)
-		handled |= sata_rcar_serr_interrupt(ap);
+		sata_rcar_serr_interrupt(ap);
 
+	handled = 1;
 done:
 	spin_unlock_irqrestore(&host->lock, flags);
 



  parent reply	other threads:[~2013-06-05 21:34 UTC|newest]

Thread overview: 128+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-05 21:32 [ 000/127] 3.9.5-stable review Greg Kroah-Hartman
2013-06-05 21:32 ` [ 001/127] avr32: fix relocation check for signed 18-bit offset Greg Kroah-Hartman
2013-06-05 21:32 ` [ 002/127] USB: OHCI: fix logic for scheduling isochronous URBs Greg Kroah-Hartman
2013-06-05 21:32 ` [ 003/127] USB: fix latency in uhci-hcd and ohci-hcd Greg Kroah-Hartman
2013-06-05 21:32 ` [ 004/127] ARM: plat-orion: Fix num_resources and id for ge10 and ge11 Greg Kroah-Hartman
2013-06-05 21:32 ` [ 005/127] ARM: OMAP: fix __init section mismatch for _enable_preprogram Greg Kroah-Hartman
2013-06-05 21:32 ` [ 006/127] ARM: AM33XX: Add missing .clkdm_name to clkdiv32k_ick clock Greg Kroah-Hartman
2013-06-05 21:32 ` [ 007/127] ARM: 7723/1: crypto: sha1-armv4-large.S: fix SP handling Greg Kroah-Hartman
2013-06-05 21:32 ` [ 008/127] ARM: at91/trivial: fix model name for SAM9X25-EK Greg Kroah-Hartman
2013-06-05 21:32 ` [ 009/127] ARM: at91: rm9200 fix time support Greg Kroah-Hartman
2013-06-05 21:32 ` [ 010/127] ARM: at91/dt: fix macb pinctrl_macb_rmii_mii_alt definition Greg Kroah-Hartman
2013-06-05 21:32 ` [ 011/127] cfg80211: fix WoWLAN wakeup tracing Greg Kroah-Hartman
2013-06-05 21:32 ` [ 012/127] cfg80211: fix wiphy_register error path Greg Kroah-Hartman
2013-06-05 21:33 ` [ 013/127] cfg80211: fix sending WoWLAN TCP wakeup settings Greg Kroah-Hartman
2013-06-05 21:33 ` [ 014/127] mac80211: use just spin_lock() in ieee80211_get_tkip_p2k() Greg Kroah-Hartman
2013-06-05 21:33 ` [ 015/127] mac80211: fix AP-mode frame matching Greg Kroah-Hartman
2013-06-05 21:33 ` [ 016/127] iwlwifi: mvm: Always use SCAN_TYPE_FORCED Greg Kroah-Hartman
2013-06-05 21:33 ` [ 017/127] iwlwifi: mvm: Prevent setting assoc flag in MAC_CONTEXT_CMD Greg Kroah-Hartman
2013-06-05 21:33 ` [ 018/127] staging: vt6656: [bug] Fix missing spin lock in iwctl_siwpower Greg Kroah-Hartman
2013-06-05 21:33 ` [ 019/127] staging: vt6656: use free_netdev instead of kfree Greg Kroah-Hartman
2013-06-05 21:33 ` [ 020/127] usb, chipidea: fix link error when USB_EHCI_HCD is a module Greg Kroah-Hartman
2013-06-05 21:33 ` [ 021/127] usb: option: Add Telewell TW-LTE 4G Greg Kroah-Hartman
2013-06-05 21:33 ` [ 022/127] USB: option: add device IDs for Dell 5804 (Novatel E371) WWAN card Greg Kroah-Hartman
2013-06-05 21:33 ` [ 023/127] USB: ftdi_sio: Add support for Newport CONEX motor drivers Greg Kroah-Hartman
2013-06-05 21:33 ` [ 024/127] USB: cxacru: potential underflow in cxacru_cm_get_array() Greg Kroah-Hartman
2013-06-05 21:33 ` [ 025/127] TTY: Fix tty miss restart after we turn off flow-control Greg Kroah-Hartman
2013-06-05 21:33 ` [ 026/127] USB: Blacklisted Cinterions PLxx WWAN Interface Greg Kroah-Hartman
2013-06-05 21:33 ` [ 027/127] USB: reset resume quirk needed by a hub Greg Kroah-Hartman
2013-06-05 21:33 ` [ 028/127] USB: xHCI: override bogus bulk wMaxPacketSize values Greg Kroah-Hartman
2013-06-05 21:33 ` [ 029/127] USB: UHCI: fix for suspend of virtual HP controller Greg Kroah-Hartman
2013-06-05 21:33 ` [ 030/127] Input: egalax_ts - ABS_MT_POSITION_Y not reported well Greg Kroah-Hartman
2013-06-05 21:33 ` [ 031/127] Drivers: hv: Fix a bug in get_vp_index() Greg Kroah-Hartman
2013-06-05 21:33 ` [ 032/127] cifs: only set ops for inodes in I_NEW state Greg Kroah-Hartman
2013-06-05 21:33 ` [ 033/127] ARC: copy_(to|from)_user() to honor usermode-access permissions Greg Kroah-Hartman
2013-06-05 21:33 ` [ 034/127] drivers/char/random.c: fix priming of last_data Greg Kroah-Hartman
2013-06-05 21:33 ` [ 035/127] random: fix accounting race condition with lockless irq entropy_count update Greg Kroah-Hartman
2013-06-05 21:33 ` [ 036/127] fat: fix possible overflow for fat_clusters Greg Kroah-Hartman
2013-06-05 21:33 ` [ 037/127] tg3: Skip powering down function 0 on certain serdes devices Greg Kroah-Hartman
2013-06-05 21:33 ` [ 038/127] tg3: Fix data corruption on 5725 with TSO Greg Kroah-Hartman
2013-06-05 21:33 ` [ 039/127] perf: net_dropmonitor: Fix trace parameter order Greg Kroah-Hartman
2013-06-05 21:33 ` [ 040/127] perf: net_dropmonitor: Fix symbol-relative addresses Greg Kroah-Hartman
2013-06-05 21:33 ` [ 041/127] ath9k: Fix crash on module unload Greg Kroah-Hartman
2013-06-05 21:33 ` [ 042/127] ath9k_hw: Enable manual peak calibration for AR9485 Greg Kroah-Hartman
2013-06-05 21:33 ` [ 043/127] ocfs2: goto out_unlock if ocfs2_get_clusters_nocache() failed in ocfs2_fiemap() Greg Kroah-Hartman
2013-06-05 21:33 ` [ 044/127] Kirkwood: Enable PCIe port 1 on QNAP TS-11x/TS-21x Greg Kroah-Hartman
2013-06-05 21:33 ` [ 045/127] drivers/leds/leds-ot200.c: fix error caused by shifted mask Greg Kroah-Hartman
2013-06-05 21:33 ` [ 046/127] rapidio/tsi721: fix bug in MSI interrupt handling Greg Kroah-Hartman
2013-06-05 21:33 ` [ 047/127] mm compaction: fix of improper cache flush in migration code Greg Kroah-Hartman
2013-06-05 21:33 ` [ 048/127] klist: del waiter from klist_remove_waiters before wakeup waitting process Greg Kroah-Hartman
2013-06-05 21:33 ` [ 049/127] wait: fix false timeouts when using wait_event_timeout() Greg Kroah-Hartman
2013-06-05 21:33 ` [ 050/127] nilfs2: fix issue of nilfs_set_page_dirty() for page at EOF boundary Greg Kroah-Hartman
2013-06-05 21:33 ` [ 051/127] mm: mmu_notifier: re-fix freed page still mapped in secondary MMU Greg Kroah-Hartman
2013-06-05 21:33 ` [ 052/127] mm: memcg: remove incorrect VM_BUG_ON for swap cache pages in uncharge Greg Kroah-Hartman
2013-06-05 21:33 ` [ 053/127] drivers/block/brd.c: fix brd_lookup_page() race Greg Kroah-Hartman
2013-06-05 21:33 ` [ 054/127] mm/pagewalk.c: walk_page_range should avoid VM_PFNMAP areas Greg Kroah-Hartman
2013-06-05 21:33 ` [ 055/127] mm/THP: use pmd_populate() to update the pmd with pgtable_t pointer Greg Kroah-Hartman
2013-06-05 21:33 ` [ 056/127] SCSI: ipr: Need to reset adapter after the 6th EEH error Greg Kroah-Hartman
2013-06-05 21:33 ` [ 057/127] x86: Allow FPU to be used at interrupt time even with eagerfpu Greg Kroah-Hartman
2013-06-05 21:33 ` [ 058/127] x86-64, init: Fix a possible wraparound bug in switchover in head_64.S Greg Kroah-Hartman
2013-06-05 21:33 ` [ 059/127] x86, range: fix missing merge during add range Greg Kroah-Hartman
2013-06-05 21:33 ` [ 060/127] x86, crc32-pclmul: Fix build with older binutils Greg Kroah-Hartman
2013-06-05 21:33 ` [ 061/127] module: dont unlink the module until weve removed all exposure Greg Kroah-Hartman
2013-06-05 21:33 ` [ 062/127] xfs: kill suid/sgid through the truncate path Greg Kroah-Hartman
2013-06-05 21:33 ` [ 063/127] arm64: dont kill the kernel on a bad esr from el0 Greg Kroah-Hartman
2013-06-05 21:33 ` [ 064/127] ARM: SAMSUNG: Export MIPI CSIS/DSIM PHY control functions Greg Kroah-Hartman
2013-06-05 21:33 ` [ 065/127] SUNRPC: Prevent an rpc_task wakeup race Greg Kroah-Hartman
2013-06-05 21:33 ` [ 066/127] svcrpc: fix failures to handle -1 uids and gids Greg Kroah-Hartman
2013-06-05 21:33 ` [ 067/127] ASoC: cs42l52: fix default value for MASTERA_VOL Greg Kroah-Hartman
2013-06-05 21:33 ` [ 068/127] ASoC: wm5110: Correct DSP4R Mixer control name Greg Kroah-Hartman
2013-06-05 21:33 ` [ 069/127] drm/i915: Adding more reserved PCI IDs for Haswell Greg Kroah-Hartman
2013-06-05 21:33 ` [ 070/127] drm/radeon: fix typo in cu_per_sh on verde Greg Kroah-Hartman
2013-06-05 21:33 ` [ 071/127] drm/radeon: fix card_posted check for newer asics Greg Kroah-Hartman
2013-06-05 21:33 ` [ 072/127] crypto: caam - fix inconsistent assoc dma mapping direction Greg Kroah-Hartman
2013-06-05 21:34 ` [ 073/127] cifs: fix potential buffer overrun when composing a new options string Greg Kroah-Hartman
2013-06-05 21:34 ` [ 074/127] sata_rcar: clear STOP bit in bmdma_start() method Greg Kroah-Hartman
2013-06-05 21:34 ` Greg Kroah-Hartman [this message]
2013-06-05 21:34 ` [ 076/127] ata_piix: add PCI IDs for Intel BayTail Greg Kroah-Hartman
2013-06-05 21:34 ` [ 077/127] libata: make ata_exec_internal_sg honor DMADIR Greg Kroah-Hartman
2013-06-05 21:34 ` [ 078/127] m68k/mac: Fix unexpected interrupt with CONFIG_EARLY_PRINTK Greg Kroah-Hartman
2013-06-05 21:34 ` [ 079/127] s390/pgtable: Fix check for pgste/storage key handling Greg Kroah-Hartman
2013-06-05 21:34 ` [ 080/127] cgroup: initialize xattr before calling d_instantiate() Greg Kroah-Hartman
2013-06-05 21:34 ` [ 081/127] cgroup: fix a subtle bug in descendant pre-order walk Greg Kroah-Hartman
2013-06-05 21:34 ` [ 082/127] powerpc/32bit:Store temporary result in r0 instead of r8 Greg Kroah-Hartman
2013-06-05 21:34 ` [ 083/127] powerpc/tm: Make room for hypervisor in abort cause codes Greg Kroah-Hartman
2013-06-05 21:34 ` [ 084/127] powerpc/tm: Update cause codes documentation Greg Kroah-Hartman
2013-06-05 21:34 ` [ 085/127] powerpc/tm: Fix userspace stack corruption on signal delivery for active transactions Greg Kroah-Hartman
2013-06-05 21:34 ` [ 086/127] powerpc/tm: Abort on emulation and alignment faults Greg Kroah-Hartman
2013-06-05 21:34 ` [ 087/127] powerpc/tm: Move TM abort cause codes to uapi Greg Kroah-Hartman
2013-06-05 21:34 ` [ 088/127] iscsi-target: fix heap buffer overflow on error Greg Kroah-Hartman
2013-06-05 21:34 ` [ 089/127] ib_srpt: Call target_sess_cmd_list_set_waiting during shutdown_session Greg Kroah-Hartman
2013-06-05 21:34 ` [ 090/127] NFSv4: Fix a thinko in nfs4_try_open_cached Greg Kroah-Hartman
2013-06-05 21:34 ` [ 091/127] KVM: Emulate multibyte NOP Greg Kroah-Hartman
2013-06-05 21:34 ` [ 092/127] KVM: fix sil/dil/bpl/spl in the mod/rm fields Greg Kroah-Hartman
2013-06-05 21:34 ` [ 093/127] regulator: palmas: Fix "enable_reg" to point to the correct reg for SMPS10 Greg Kroah-Hartman
2013-06-05 21:34 ` [ 094/127] powerpc/pseries: Always enable CONFIG_HOTPLUG_CPU on PSERIES SMP Greg Kroah-Hartman
2013-06-05 21:34 ` [ 095/127] reiserfs: fix deadlock with nfs racing on create/lookup Greg Kroah-Hartman
2013-06-05 21:34 ` [ 096/127] reiserfs: fix problems with chowning setuid file w/ xattrs Greg Kroah-Hartman
2013-06-05 21:34 ` [ 097/127] reiserfs: fix spurious multiple-fill in reiserfs_readdir_dentry Greg Kroah-Hartman
2013-06-05 21:34 ` [ 098/127] jfs: fix a couple races Greg Kroah-Hartman
2013-06-05 21:34 ` [ 099/127] xen-netback: remove skb in xen_netbk_alloc_page Greg Kroah-Hartman
2013-06-05 21:34 ` [ 100/127] iwlwifi: mvm: fix aggregation drain flow Greg Kroah-Hartman
2013-06-05 21:34 ` [ 101/127] iommu/amd: Re-enable IOMMU event log interrupt after handling Greg Kroah-Hartman
2013-06-05 21:34 ` [ 102/127] iommu/amd: Workaround for ERBT1312 Greg Kroah-Hartman
2013-06-05 21:34 ` [ 103/127] ACPI / PM: Allow device power states to be used for CONFIG_PM unset Greg Kroah-Hartman
2013-06-05 21:34 ` [ 104/127] ACPI / video: Add "Asus UL30A" to ACPI video detect blacklist Greg Kroah-Hartman
2013-06-05 21:34 ` [ 105/127] drm/nvc0/ce: disable ce1 on a number of chipsets Greg Kroah-Hartman
2013-06-05 21:34 ` [ 106/127] mac80211: fix direct probe auth Greg Kroah-Hartman
2013-06-05 21:34 ` [ 107/127] mac80211: close AP_VLAN interfaces before unregistering all Greg Kroah-Hartman
2013-06-05 21:34 ` [ 108/127] iwlwifi: dvm: fix zero LQ CMD sending avoidance Greg Kroah-Hartman
2013-06-05 21:34 ` [ 109/127] iwlwifi: mvm: tell firmware to let multicast frames in Greg Kroah-Hartman
2013-06-05 21:34 ` [ 110/127] cfg80211: check wdev->netdev in connection work Greg Kroah-Hartman
2013-06-05 21:34 ` [ 111/127] ath9k: use correct OTP register offsets for AR9550 Greg Kroah-Hartman
2013-06-05 21:34 ` [ 112/127] tg3: Add read dma workaround for 5720 Greg Kroah-Hartman
2013-06-05 21:34 ` [ 113/127] net: can: kvaser_usb: fix reception on "USBcan Pro" and "USBcan R" type hardware Greg Kroah-Hartman
2013-06-05 21:34 ` [ 114/127] IB/iser: Return error to upper layers on EAGAIN registration failures Greg Kroah-Hartman
2013-06-05 21:34 ` [ 115/127] ASoC: davinci: fix sample rotation Greg Kroah-Hartman
2013-06-05 21:34 ` [ 116/127] fuse: fix readdirplus Oops in fuse_dentry_revalidate Greg Kroah-Hartman
2013-06-05 21:34 ` [ 117/127] target: Re-instate sess_wait_list for target_wait_for_sess_cmds Greg Kroah-Hartman
2013-06-05 21:34 ` [ 118/127] target/file: Fix off-by-one READ_CAPACITY bug for !S_ISBLK export Greg Kroah-Hartman
2013-06-05 21:34 ` [ 119/127] leds: leds-gpio: reserve gpio before using it Greg Kroah-Hartman
2013-06-05 21:34 ` [ 120/127] xen-netback: coalesce slots in TX path and fix regressions Greg Kroah-Hartman
2013-06-05 21:34 ` [ 121/127] xen-netback: dont disconnect frontend when seeing oversize packet Greg Kroah-Hartman
2013-06-05 21:34 ` [ 122/127] xen-netback: remove redundent parameter in netbk_count_requests Greg Kroah-Hartman
2013-06-05 21:34 ` [ 123/127] xen-netback: avoid allocating variable size array on stack Greg Kroah-Hartman
2013-06-05 21:34 ` [ 124/127] xen-netfront: reduce gso_max_size to account for max TCP header Greg Kroah-Hartman
2013-06-05 21:34 ` [ 125/127] iwlwifi: mvm: remove P2P_DEVICE support Greg Kroah-Hartman
2013-06-05 21:34 ` [ 126/127] mac80211_hwsim: " Greg Kroah-Hartman
2013-06-05 21:34 ` [ 127/127] xen-netback: better names for thresholds 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=20130605213226.451713988@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.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