linux_dsm_epyc7002/drivers/i2c/busses
Paul Kocialkowski f275a46594 i2c: bcm2835: Clear current buffer pointers and counts after a transfer
The driver's interrupt handler checks whether a message is currently
being handled with the curr_msg pointer. When it is NULL, the interrupt
is considered to be unexpected. Similarly, the i2c_start_transfer
routine checks for the remaining number of messages to handle in
num_msgs.

However, these values are never cleared and always keep the message and
number relevant to the latest transfer (which might be done already and
the underlying message memory might have been freed).

When an unexpected interrupt hits with the DONE bit set, the isr will
then try to access the flags field of the curr_msg structure, leading
to a fatal page fault.

The msg_buf and msg_buf_remaining fields are also never cleared at the
end of the transfer, which can lead to similar pitfalls.

Fix these issues by introducing a cleanup function and always calling
it after a transfer is finished.

Fixes: e247454103 ("i2c: bcm2835: Fix hang for writing messages larger than 16 bytes")
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2019-02-15 09:45:05 +01:00
..
i2c-acorn.c
i2c-ali15x3.c
i2c-ali1535.c
i2c-ali1563.c
i2c-altera.c
i2c-amd756-s4882.c
i2c-amd756.c
i2c-amd8111.c
i2c-aspeed.c
i2c-at91.c
i2c-au1550.c
i2c-axxia.c i2c: axxia: support sequence command mode 2018-12-17 23:28:50 +01:00
i2c-bcm2835.c i2c: bcm2835: Clear current buffer pointers and counts after a transfer 2019-02-15 09:45:05 +01:00
i2c-bcm-iproc.c
i2c-bcm-kona.c
i2c-brcmstb.c
i2c-cadence.c i2c: cadence: Fix the hold bit setting 2019-02-15 09:42:17 +01:00
i2c-cbus-gpio.c
i2c-cht-wc.c
i2c-cpm.c
i2c-cros-ec-tunnel.c i2c: i2c-cros-ec-tunnel: Switch to SPDX identifier. 2018-12-17 23:08:41 +01:00
i2c-davinci.c
i2c-designware-baytrail.c More ACPI updates for 4.20-rc1 2018-10-30 09:15:31 -07:00
i2c-designware-common.c More ACPI updates for 4.20-rc1 2018-10-30 09:15:31 -07:00
i2c-designware-core.h More ACPI updates for 4.20-rc1 2018-10-30 09:15:31 -07:00
i2c-designware-master.c
i2c-designware-pcidrv.c
i2c-designware-platdrv.c More ACPI updates for 4.20-rc1 2018-10-30 09:15:31 -07:00
i2c-designware-slave.c
i2c-digicolor.c
i2c-diolan-u2c.c
i2c-dln2.c
i2c-efm32.c
i2c-eg20t.c
i2c-elektor.c
i2c-emev2.c
i2c-exynos5.c
i2c-fsi.c
i2c-gpio.c
i2c-highlander.c
i2c-hix5hd2.c
i2c-hydra.c
i2c-i801.c
i2c-ibm_iic.c i2c: Remove caller signal_pending branch predictions 2018-11-27 12:59:16 +01:00
i2c-ibm_iic.h
i2c-img-scb.c
i2c-imx-lpi2c.c
i2c-imx.c i2c: imx: don't print error message on probe defer 2018-11-27 12:55:45 +01:00
i2c-iop3xx.c
i2c-iop3xx.h
i2c-isch.c
i2c-ismt.c i2c: ismt: Add support for Intel Cedar Fork 2019-01-03 20:02:32 +01:00
i2c-jz4780.c
i2c-kempld.c
i2c-lpc2k.c
i2c-meson.c
i2c-mlxcpld.c
i2c-mpc.c
i2c-mt65xx.c
i2c-mv64xxx.c
i2c-mxs.c
i2c-nforce2-s4985.c
i2c-nforce2.c
i2c-nomadik.c
i2c-nvidia-gpu.c i2c: nvidia-gpu: mark resume function as __maybe_unused 2018-12-11 21:39:43 +01:00
i2c-ocores.c
i2c-octeon-core.c
i2c-octeon-core.h
i2c-octeon-platdrv.c
i2c-omap.c i2c: omap: Use noirq system sleep pm ops to idle device for suspend 2019-02-05 13:13:20 +01:00
i2c-opal.c
i2c-owl.c i2c: Add Actions Semiconductor Owl family S700 I2C support 2019-01-03 20:36:18 +01:00
i2c-parport-light.c
i2c-parport.c
i2c-parport.h
i2c-pasemi.c
i2c-pca-isa.c
i2c-pca-platform.c
i2c-piix4.c
i2c-pmcmsp.c
i2c-pnx.c
i2c-powermac.c i2c: powermac: Use of_node_name_eq for node name comparisons 2018-12-11 21:16:28 +01:00
i2c-puv3.c
i2c-pxa-pci.c
i2c-pxa.c
i2c-qcom-geni.c i2c: qcom-geni: Fix runtime PM mismatch with child devices 2018-11-09 17:25:48 +01:00
i2c-qup.c
i2c-rcar.c i2c: rcar: check bus state before reinitializing 2018-11-27 14:00:36 +01:00
i2c-riic.c
i2c-rk3x.c
i2c-robotfuzz-osif.c
i2c-s3c2410.c
i2c-scmi.c i2c: scmi: Fix probe error on devices with an empty SMB0001 ACPI device node 2018-12-06 23:14:59 +01:00
i2c-sh7760.c
i2c-sh_mobile.c i2c: sh_mobile: Add support for r8a774c0 (RZ/G2E) 2018-12-17 23:20:09 +01:00
i2c-sibyte.c
i2c-simtec.c
i2c-sirf.c
i2c-sis96x.c
i2c-sis630.c
i2c-sis5595.c
i2c-sprd.c
i2c-st.c
i2c-stm32.c
i2c-stm32.h
i2c-stm32f4.c
i2c-stm32f7.c i2c: i2c-stm32f7: add PM Runtime support 2018-12-01 00:14:45 +01:00
i2c-stu300.c
i2c-sun6i-p2wi.c
i2c-synquacer.c
i2c-taos-evm.c
i2c-tegra-bpmp.c
i2c-tegra.c i2c: tegra: Fix Maximum transfer size 2019-01-11 00:15:04 +01:00
i2c-thunderx-pcidrv.c
i2c-tiny-usb.c
i2c-uniphier-f.c i2c: uniphier-f: fix violation of tLOW requirement for Fast-mode 2018-12-06 23:14:59 +01:00
i2c-uniphier.c i2c: uniphier: fix violation of tLOW requirement for Fast-mode 2018-12-06 23:14:59 +01:00
i2c-versatile.c
i2c-via.c
i2c-viapro.c
i2c-viperboard.c
i2c-wmt.c
i2c-xgene-slimpro.c
i2c-xiic.c
i2c-xlp9xx.c
i2c-xlr.c
i2c-zx2967.c
Kconfig i2c: add i2c bus driver for NVIDIA GPU 2018-11-09 17:46:43 +01:00
Makefile i2c: add i2c bus driver for NVIDIA GPU 2018-11-09 17:46:43 +01:00
scx200_acb.c