From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Torben Hohn <torbenh@linutronix.de>,
Thomas Gleixner <tglx@linutronix.de>, Felipe Balbi <balbi@ti.com>
Subject: [PATCH 3.15 014/122] usb: musb: Ensure that cppi41 timer gets armed on premature DMA TX irq
Date: Mon, 7 Jul 2014 16:56:16 -0700 [thread overview]
Message-ID: <20140707235734.675542467@linuxfoundation.org> (raw)
In-Reply-To: <20140707235734.234226883@linuxfoundation.org>
3.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <tglx@linutronix.de>
commit c58d80f523ffc15ef4d062fc7aeb03793fe39701 upstream.
Some TI chips raise the DMA complete interrupt before the actual
transfer has been completed. The code tries to busy wait for a few
microseconds and if that fails it arms an hrtimer to recheck. So far
so good, but that has the following issue:
CPU 0 CPU1
start_next_transfer(RQ1);
DMA interrupt
if (premature_irq(RQ1))
if (!hrtimer_active(timer))
hrtimer_start(timer);
hrtimer expires
timer->state = CALLBACK_RUNNING;
timer->fn()
cppi41_recheck_tx_req()
complete_request(RQ1);
if (requests_pending())
start_next_transfer(RQ2);
DMA interrupt
if (premature_irq(RQ2))
if (!hrtimer_active(timer))
hrtimer_start(timer);
timer->state = INACTIVE;
The premature interrupt of request2 on CPU1 does not arm the timer and
therefor the request completion never happens because it checks for
!hrtimer_active(). hrtimer_active() evaluates:
timer->state != HRTIMER_STATE_INACTIVE
which of course evaluates to true in the above case as timer->state is
CALLBACK_RUNNING.
That's clearly documented:
* A timer is active, when it is enqueued into the rbtree or the
* callback function is running or it's in the state of being migrated
* to another cpu.
But that's not what the code wants to check. The code wants to check
whether the timer is queued, i.e. whether its armed and waiting for
expiry.
We have a helper function for this: hrtimer_is_queued(). This
evaluates:
timer->state & HRTIMER_STATE_QUEUED
So in the above case this evaluates to false and therefor forces the
DMA interrupt on CPU1 to call hrtimer_start().
Use hrtimer_is_queued() instead of hrtimer_active() and evrything is
good.
Reported-by: Torben Hohn <torbenh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/musb/musb_cppi41.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/usb/musb/musb_cppi41.c
+++ b/drivers/usb/musb/musb_cppi41.c
@@ -318,7 +318,7 @@ static void cppi41_dma_callback(void *pr
}
list_add_tail(&cppi41_channel->tx_check,
&controller->early_tx_list);
- if (!hrtimer_active(&controller->early_tx)) {
+ if (!hrtimer_is_queued(&controller->early_tx)) {
hrtimer_start_range_ns(&controller->early_tx,
ktime_set(0, 140 * NSEC_PER_USEC),
40 * NSEC_PER_USEC,
next prev parent reply other threads:[~2014-07-08 1:18 UTC|newest]
Thread overview: 122+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-07 23:56 [PATCH 3.15 000/122] 3.15.5-stable review Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 001/122] SCSI: use the scsi data buffer length to extract transfer size Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 003/122] ibmvscsi: Abort init sequence during error recovery Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 004/122] ibmvscsi: Add memory barriers for send / receive Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 005/122] virtio-scsi: avoid cancelling uninitialized work items Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 006/122] scsi_error: fix invalid setting of host byte Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 007/122] virtio-scsi: fix various bad behavior on aborted requests Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 008/122] xhci: Use correct SLOT ID when handling a reset device command Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 009/122] xhci: correct burst count field for isoc transfers on 1.0 xhci hosts Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 010/122] xhci: Fix runtime suspended xhci from blocking system suspend Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 011/122] USB: option: add device ID for SpeedUp SU9800 usb 3g modem Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 013/122] usb: musb: ux500: dont propagate the OF node Greg Kroah-Hartman
2014-07-07 23:56 ` Greg Kroah-Hartman [this message]
2014-07-07 23:56 ` [PATCH 3.15 015/122] usb: musb: Fix panic upon musb_am335x module removal Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 016/122] usb: chipidea: udc: delete td from reqs td list at ep_dequeue Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 017/122] USB: ftdi_sio: fix null deref at port probe Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 020/122] rt2x00: disable TKIP on USB Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 021/122] rt2x00: fix rfkill regression on rt2500pci Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 022/122] mtd: eLBC NAND: fix subpage write support Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 023/122] mtd: nand: omap: fix BCHx ecc.correct to return detected bit-flips in erased-page Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 024/122] mtd: pxa3xx_nand: make the driver work on big-endian systems Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 025/122] vgaswitcheroo: switch the mux to the igp on power down when runpm is enabled Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 026/122] drm/nouveau/kms/nv04-nv40: fix pageflip events via special case Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 027/122] drm/nouveau/disp/nv04-nv40: abort scanoutpos query on vga analog Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 028/122] drm/nouveau/kms: reference vblank for crtc during pageflip Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 029/122] drm/radeon: only apply hdmi bpc pll flags when encoder mode is hdmi Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 030/122] drm/radeon: fix typo in radeon_connector_is_dp12_capable() Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 031/122] drm/radeon/dp: fix lane/clock setup for dp 1.2 capable devices Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 032/122] drm/radeon/atom: fix dithering on certain panels Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 033/122] drm/radeon: add missing vce init case for hawaii Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 034/122] drm/radeon/dpm: fix typo in vddci setup for eg/btc Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 036/122] drm/radeon/cik: fix typo in EOP packet Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 037/122] drm/nv50-/mc: fix kms pageflip events by reordering irq handling order Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 038/122] drm/gk208/gr: add missing registers to grctx init Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 039/122] drm/i915/bdw: Only use 2g GGTT for 32b platforms Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 040/122] drm/i915: Reorder semaphore deadlock check Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 041/122] drm/i915: Disable FBC by default also on Haswell and later Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 043/122] drm/i915: set backlight duty cycle after backlight enable for gen4 Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 044/122] drm/i915, HD-audio: Dont continue probing when nomodeset is given Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 045/122] drm/i915: Hold the table lock whilst walking the files idr and counting the objects in debugfs Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 046/122] drm/i915: default to having backlight if VBT not available Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 047/122] drm/i95: Initialize active ring->pid to -1 Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 048/122] drm: fix NULL pointer access by wrong ioctl Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 049/122] drm/i915: provide interface for audio driver to query cdclk Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 050/122] ALSA: hda - restore BCLK M/N value as per CDCLK for HSW/BDW display HDA controller Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 051/122] drm/vmwgfx: Fix incorrect write to read-only register v2: Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 053/122] Bluetooth: Fix incorrectly overriding conn->src_type Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 054/122] Bluetooth: Fix SSP acceptor just-works confirmation without MITM Greg Kroah-Hartman
2014-07-07 23:56 ` Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 055/122] Bluetooth: Fix check for connection encryption Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 056/122] Bluetooth: Fix indicating discovery state when canceling inquiry Greg Kroah-Hartman
2014-07-07 23:56 ` [PATCH 3.15 057/122] Bluetooth: Refactor discovery stopping into its own function Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 058/122] Bluetooth: Reuse hci_stop_discovery function when cleaning up HCI state Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 059/122] Bluetooth: Fix setting correct authentication information for SMP STK Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 060/122] Bluetooth: Fix deadlock in l2cap_conn_del() Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 061/122] Bluetooth: Fix locking of hdev when calling into SMP code Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 062/122] Bluetooth: Allow change security level on ATT_CID in slave role Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 063/122] dm era: check for a non-NULL metadata object before closing it Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 064/122] dm thin: update discard_granularity to reflect the thin-pool blocksize Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 065/122] rbd: use reference counts for image requests Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 066/122] rbd: handle parent_overlap on writes correctly Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 067/122] hwmon: (ina2xx) Cast to s16 on shunt and current regs Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 068/122] intel_pstate: Correct rounding in busy calculation Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 069/122] twl4030-madc: Request processed values in twl4030_get_madc_conversion Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 071/122] mac80211: dont check netdev state for debugfs read/write Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 073/122] iwlwifi: pcie: try to get ownership several times Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 074/122] mm: nommu: per-thread vma cache fix Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 075/122] hugetlb: fix copy_hugetlb_page_range() to handle migration/hwpoisoned entry Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 076/122] mm, pcp: allow restoring percpu_pagelist_fraction default Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 077/122] ia64: arch/ia64/include/uapi/asm/fcntl.h needs personality.h Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 078/122] ARM: mvebu: Fix the improper use of the compatible string armada38x using a wildcard Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 079/122] arm64: mm: Make icache synchronisation logic huge page aware Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 080/122] ARM: OMAP2+: Fix parser-bug in platform muxing code Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 082/122] net: allwinner: emac: Add missing free_irq Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 085/122] CIFS: fix mount failure with broken pathnames when smb3 mount with mapchars option Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 086/122] regulator: tps65218: Add the missing of_node assignment in probe Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 087/122] regulator: tps65218: Correct the the config register for LDO1 Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 088/122] iommu/vt-d: fix bug in handling multiple RMRRs for the same PCI device Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 089/122] blkcg: fix use-after-free in __blkg_release_rcu() by making blkcg_gq refcnt an atomic_t Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 090/122] ext4: Fix buffer double free in ext4_alloc_branch() Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 091/122] ext4: Fix hole punching for files with indirect blocks Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 093/122] zram: revalidate disk after capacity change Greg Kroah-Hartman
2014-07-08 10:56 ` Sergey Senozhatsky
2014-07-08 15:02 ` Greg Kroah-Hartman
2014-07-09 5:39 ` Minchan Kim
2014-07-07 23:57 ` [PATCH 3.15 094/122] KVM: x86: Increase the number of fixed MTRR regs to 10 Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 095/122] KVM: x86: preserve the high 32-bits of the PAT register Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 096/122] kvm: fix wrong address when writing Hyper-V tsc page Greg Kroah-Hartman
2014-07-07 23:57 ` Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 097/122] iio: of_iio_channel_get_by_name() returns non-null pointers for error legs Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 098/122] staging: iio/ad7291: fix error code in ad7291_probe() Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 099/122] nfsd: fix rare symlink decoding bug Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 100/122] tools: ffs-test: fix header values endianess Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 101/122] staging: tidspbridge: fix an erroneous removal of parentheses Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 102/122] tracing: Remove ftrace_stop/start() from reading the trace file Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 103/122] tracing/uprobes: Revert "Support mix of ftrace and perf" Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 104/122] tracing/uprobes: Fix the usage of uprobe_buffer_enable() in probe_event_enable() Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 105/122] btrfs: only unlock block in verify_parent_transid if we locked it Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 106/122] md: flush writes before starting a recovery Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 107/122] irqchip: spear_shirq: Fix interrupt offset Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 108/122] ARC: Fix build breakage for !CONFIG_ARC_DW2_UNWIND Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 109/122] mlx4_core: Fix incorrect FLAGS1 bitmap test in mlx4_QUERY_FUNC_CAP Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 110/122] net/mlx4_core: Keep only one driver entry release mlx4_priv Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 111/122] clk: qcom: Fix clk_rcg2_is_enabled() check Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 112/122] clk: qcom: Fix mmcc-8974s PLL configurations Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 113/122] serial: Fix IGNBRK handling Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 114/122] tty: Correct INPCK handling Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 115/122] netfilter: ctnetlink: fix dumping of dying/unconfirmed conntracks Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 116/122] netfilter: nf_nat: fix oops on netns removal Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.15 117/122] netfilter: ctnetlink: fix refcnt leak in dying/unconfirmed list dumper Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.15 118/122] mmc: rtsx: add R1-no-CRC mmc command type handle Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.15 119/122] drm/i915: fix display power sw state reporting Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.15 120/122] arch/unicore32/mm/alignment.c: include "asm/pgtable.h" to avoid compiling error Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.15 121/122] drivers/video/fbdev/fb-puv3.c: Add header files for function unifb_mmap Greg Kroah-Hartman
2014-07-07 23:58 ` Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.15 122/122] mm/numa: Remove BUG_ON() in __handle_mm_fault() Greg Kroah-Hartman
2014-07-07 23:58 ` Greg Kroah-Hartman
2014-07-08 13:26 ` [PATCH 3.15 000/122] 3.15.5-stable review Guenter Roeck
2014-07-08 16:50 ` Satoru Takeuchi
2014-07-08 22:16 ` Greg Kroah-Hartman
2014-07-12 6:03 ` Guenter Roeck
2014-07-08 19:30 ` Shuah Khan
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=20140707235734.675542467@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=balbi@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torbenh@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.