From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Linus Walleij <linus.walleij@linaro.org>,
Lucas De Marchi <lucas.de.marchi@gmail.com>
Subject: [PATCH 4.2 108/110] pinctrl: baytrail: Serialize all register access
Date: Fri, 6 Nov 2015 11:19:55 -0800 [thread overview]
Message-ID: <20151106191709.603097089@linuxfoundation.org> (raw)
In-Reply-To: <20151106191703.247930828@linuxfoundation.org>
4.2-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mika Westerberg <mika.westerberg@linux.intel.com>
commit 39ce8150a079e3ae6ed9abf26d7918a558ef7c19 upstream.
There is a hardware issue in Intel Baytrail where concurrent GPIO register
access might result reads of 0xffffffff and writes might get dropped
completely.
Prevent this from happening by taking the serializing lock in all places
where it is possible that more than one thread might be accessing the
hardware concurrently.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Lucas De Marchi <lucas.de.marchi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pinctrl/intel/pinctrl-baytrail.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
--- a/drivers/pinctrl/intel/pinctrl-baytrail.c
+++ b/drivers/pinctrl/intel/pinctrl-baytrail.c
@@ -201,6 +201,9 @@ static int byt_gpio_request(struct gpio_
struct byt_gpio *vg = to_byt_gpio(chip);
void __iomem *reg = byt_gpio_reg(chip, offset, BYT_CONF0_REG);
u32 value, gpio_mux;
+ unsigned long flags;
+
+ spin_lock_irqsave(&vg->lock, flags);
/*
* In most cases, func pin mux 000 means GPIO function.
@@ -214,18 +217,16 @@ static int byt_gpio_request(struct gpio_
value = readl(reg) & BYT_PIN_MUX;
gpio_mux = byt_get_gpio_mux(vg, offset);
if (WARN_ON(gpio_mux != value)) {
- unsigned long flags;
-
- spin_lock_irqsave(&vg->lock, flags);
value = readl(reg) & ~BYT_PIN_MUX;
value |= gpio_mux;
writel(value, reg);
- spin_unlock_irqrestore(&vg->lock, flags);
dev_warn(&vg->pdev->dev,
"pin %u forcibly re-configured as GPIO\n", offset);
}
+ spin_unlock_irqrestore(&vg->lock, flags);
+
pm_runtime_get(&vg->pdev->dev);
return 0;
@@ -277,7 +278,15 @@ static int byt_irq_type(struct irq_data
static int byt_gpio_get(struct gpio_chip *chip, unsigned offset)
{
void __iomem *reg = byt_gpio_reg(chip, offset, BYT_VAL_REG);
- return readl(reg) & BYT_LEVEL;
+ struct byt_gpio *vg = to_byt_gpio(chip);
+ unsigned long flags;
+ u32 val;
+
+ spin_lock_irqsave(&vg->lock, flags);
+ val = readl(reg);
+ spin_unlock_irqrestore(&vg->lock, flags);
+
+ return val & BYT_LEVEL;
}
static void byt_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
@@ -450,8 +459,10 @@ static void byt_irq_ack(struct irq_data
unsigned offset = irqd_to_hwirq(d);
void __iomem *reg;
+ spin_lock(&vg->lock);
reg = byt_gpio_reg(&vg->chip, offset, BYT_INT_STAT_REG);
writel(BIT(offset % 32), reg);
+ spin_unlock(&vg->lock);
}
static void byt_irq_unmask(struct irq_data *d)
next prev parent reply other threads:[~2015-11-06 19:31 UTC|newest]
Thread overview: 113+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-06 19:18 [PATCH 4.2 000/110] 4.2.6-stable review Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 001/110] mac80211: Fix hwflags debugfs file format Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 002/110] ath9k: declare required extra tx headroom Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 003/110] mmc: core: Fix init_card in 52Mhz Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 004/110] iwlwifi: dvm: fix D3 firmware PN programming Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 005/110] iwlwifi: fix firmware filename for 3160 Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 006/110] rtlwifi: rtl8821ae: Fix system lockups on boot Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 007/110] iwlwifi: mvm: clear csa countdown when AP is stopped Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 008/110] iwlwifi: mvm: fix D3 CCMP TX PN assignment Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 009/110] iwlwifi: mvm: fix D3 firmware PN programming Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 010/110] iwlwifi: mvm: init card correctly on ctkill exit check Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 011/110] iwlwifi: mvm: flush fw_dump_wk when mvm fails to start Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 012/110] iwlwifi: pci: add a few more PCI subvendor IDs for the 7265 series Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 013/110] iommu/vt-d: fix range computation when making room for large pages Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 014/110] iommu/amd: Fix BUG when faulting a PROT_NONE VMA Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 015/110] iommu/amd: Dont clear DTE flags when modifying it Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 016/110] powerpc/rtas: Validate rtas.entry before calling enter_rtas() Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 017/110] drm: fix mutex leak in drm_dp_get_mst_branch_device Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 018/110] drm: Correct arguments to list_tail_add in create blob ioctl Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 019/110] drm: crtc: integer overflow in drm_property_create_blob() Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 020/110] [media] m88ds3103: use own reg update_bits() implementation Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 021/110] [media] si2157: Bounds check firmware Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 022/110] [media] si2168: " Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 023/110] [media] rtl28xxu: fix control message flaws Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 024/110] KVM: arm: use GIC support unconditionally Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 025/110] ALSA: hdac: Explicitly add io.h Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 026/110] ALSA: hda - Fix inverted internal mic on Lenovo G50-80 Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 027/110] ALSA: hda - Fix deadlock at error in building PCM Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 028/110] ASoC: Add info callback for SX_TLV controls Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 029/110] ASoC: wm8904: Correct number of EQ registers Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 031/110] x86/setup: Extend low identity map to cover whole kernel range Greg Kroah-Hartman
2015-11-06 19:33 ` Borislav Petkov
2015-11-06 19:48 ` Greg Kroah-Hartman
2015-11-13 9:20 ` Borislav Petkov
2015-12-07 7:29 ` Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 032/110] x86/ioapic: Prevent NULL pointer dereference in setup_ioapic_dest() Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 033/110] mm: make sendfile(2) killable Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 034/110] fault-inject: fix inverted interval/probability values in printk Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 035/110] tracing: Have stack tracer force RCU to be watching Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 036/110] bus: arm-ccn: Fix irq affinity setting on CPU migration Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 037/110] drm/nouveau/gem: return only valid domain when theres only one Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 038/110] drm/radeon/dpm: dont add pwm attributes if DPM is disabled Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 039/110] drm/amdgpu: add missing dpm check for KV dpm late init Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 043/110] drm/radeon: dont try to recreate sysfs entries on resume Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 044/110] drm/amdgpu: " Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 048/110] iio: st_accel: fix interrupt handling on LIS3LV02 Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 049/110] iio: accel: sca3000: memory corruption in sca3000_read_first_n_hw_rb() Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 050/110] rbd: require stable pages if message data CRCs are enabled Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 051/110] rbd: dont leak parent_spec in rbd_dev_probe_parent() Greg Kroah-Hartman
2015-11-06 19:18 ` [PATCH 4.2 052/110] rbd: prevent kernel stack blow up on rbd map Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 053/110] ARM: EXYNOS: Fix double of_node_put() when parsing child power domains Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 054/110] ARM: orion: Fix DSA platform device after mvmdio conversion Greg Kroah-Hartman
2015-11-06 19:32 ` Florian Fainelli
2015-11-06 19:19 ` [PATCH 4.2 055/110] ARM: mvebu: correct a385-db-ap compatible string Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 056/110] ARM: dts: berlin: change BG2Qs USB PHY compatible Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 057/110] ARM: dts: Fix audio card detection on Peach boards Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 058/110] ARM: dts: imx7d: Fix UART2 base address Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 059/110] ARM: dts: am57xx-beagle-x15: set VDD_SD to always-on Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 060/110] ARM: ux500: modify initial levelshifter status Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 061/110] ARM: OMAP1: fix incorrect INT_DMA_LCD Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 062/110] ARM: 8445/1: fix vdsomunge not to depend on glibc specific byteswap.h Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 063/110] ARM: 8449/1: fix bug in vdsomunge swab32 macro Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 064/110] Revert "ARM64: unwind: Fix PC calculation" Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 065/110] arm64: kernel: fix tcr_el1.t0sz restore on systems with extended idmap Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 066/110] block: dont release bdi while request_queue has live references Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 067/110] dm btree remove: fix a bug when rebalancing nodes after removal Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 068/110] dm cache: the CLEAN_SHUTDOWN flag was not being set Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 069/110] dm btree: fix leak of bufio-backed block in btree_split_beneath error path Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 070/110] nvme: fix 32-bit build warning Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 071/110] Revert "serial: 8250_dma: dont bother DMA with small transfers" Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 073/110] i2c: mv64xxx: really allow I2C offloading Greg Kroah-Hartman
2015-11-07 16:26 ` Ben Hutchings
2015-11-06 19:19 ` [PATCH 4.2 074/110] clkdev: fix clk_add_alias() with a NULL alias device name Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 075/110] fbcon: initialize blink interval before calling fb_set_par Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 076/110] xhci: handle no ping response error properly Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 077/110] xhci: Add spurious wakeup quirk for LynxPoint-LP controllers Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 078/110] xen-blkfront: check for null drvdata in blkback_changed (XenbusStateClosing) Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 079/110] module: Fix locking in symbol_put_addr() Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 080/110] PCI: Prevent out of bounds access in numa_node override Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 081/110] ovl: free stack of paths in ovl_fill_super Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 082/110] ovl: free lower_mnt array in ovl_put_super Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 083/110] ovl: use O_LARGEFILE in ovl_copy_up() Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 084/110] ovl: fix dentry reference leak Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 085/110] ovl: fix open in stacked overlay Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 087/110] crypto: api - Only abort operations on fatal signal Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 088/110] md/raid1: submit_bio_wait() returns 0 on success Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 089/110] md/raid10: " Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 090/110] md/raid5: fix locking in handle_stripe_clean_event() Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 091/110] Revert "md: allow a partially recovered device to be hot-added to an array." Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 092/110] EDAC, sb_edac: Fix TAD presence check for sbridge_mci_bind_devs() Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 093/110] irqchip/tegra: Propagate IRQ type setting to parent Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 095/110] netfilter: ipset: Fix sleeping memory allocation in atomic context Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 096/110] btrfs: fix possible leak in btrfs_ioctl_balance() Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 097/110] kvm: irqchip: fix memory leak Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 098/110] thermal: exynos: Fix register read in TMU Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 099/110] um: Fix kernel mode fault condition Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 100/110] blk-mq: fix use-after-free in blk_mq_free_tag_set() Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 101/110] IB/cm: Fix rb-tree duplicate free and use-after-free Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 102/110] sched/deadline: Fix migration of SCHED_DEADLINE tasks Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 103/110] cpufreq: intel_pstate: Fix divide by zero on Knights Landing (KNL) Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 104/110] arm64: compat: fix stxr failure case in SWP emulation Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 105/110] NVMe: Fix memory leak on retried commands Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 106/110] drm/vmwgfx: Fix up user_dmabuf refcounting Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 107/110] thp: use is_zero_pfn() only after pte_present() check Greg Kroah-Hartman
2015-11-06 19:19 ` Greg Kroah-Hartman [this message]
2015-11-08 9:38 ` [PATCH 4.2 108/110] pinctrl: baytrail: Serialize all register access Ben Hutchings
2015-11-06 19:19 ` [PATCH 4.2 109/110] pinctrl: baytrail: Use raw_spinlock for locking Greg Kroah-Hartman
2015-11-06 19:19 ` [PATCH 4.2 110/110] xen: fix backport of previous kexec patch Greg Kroah-Hartman
2015-11-07 1:45 ` [PATCH 4.2 000/110] 4.2.6-stable review Guenter Roeck
2015-11-07 2:44 ` Greg Kroah-Hartman
2015-11-07 2:53 ` Shuah Khan
2015-11-07 3:00 ` Greg Kroah-Hartman
2015-11-09 9:27 ` Sudip Mukherjee
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=20151106191709.603097089@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.de.marchi@gmail.com \
--cc=mika.westerberg@linux.intel.com \
--cc=stable@vger.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;
as well as URLs for NNTP newsgroup(s).