tmp_suning_uos_patched/drivers/i2c/busses
Liwei Song 17e83549e1 i2c: ismt: fix wrong device address when unmap the data buffer
Fix the following kernel bug:

kernel BUG at drivers/iommu/intel-iommu.c:3260!
invalid opcode: 0000 [#5] PREEMPT SMP
Hardware name: Intel Corp. Harcuvar/Server, BIOS HAVLCRB0.X64.0013.D39.1608311820 08/31/2016
task: ffff880175389950 ti: ffff880176bec000 task.ti: ffff880176bec000
RIP: 0010:[<ffffffff8150a83b>]  [<ffffffff8150a83b>] intel_unmap+0x25b/0x260
RSP: 0018:ffff880176bef5e8  EFLAGS: 00010296
RAX: 0000000000000024 RBX: ffff8800773c7c88 RCX: 000000000000ce04
RDX: 0000000080000000 RSI: 0000000000000000 RDI: 0000000000000009
RBP: ffff880176bef638 R08: 0000000000000010 R09: 0000000000000004
R10: ffff880175389c78 R11: 0000000000000a4f R12: ffff8800773c7868
R13: 00000000ffffac88 R14: ffff8800773c7818 R15: 0000000000000001
FS:  00007fef21258700(0000) GS:ffff88017b5c0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000000066d6d8 CR3: 000000007118c000 CR4: 00000000003406e0
Stack:
 00000000ffffac88 ffffffff8199867f ffff880176bef5f8 ffff880100000030
 ffff880176bef668 ffff8800773c7c88 ffff880178288098 ffff8800772c0010
 ffff8800773c7818 0000000000000001 ffff880176bef648 ffffffff8150a86e
Call Trace:
 [<ffffffff8199867f>] ? printk+0x46/0x48
 [<ffffffff8150a86e>] intel_unmap_page+0xe/0x10
 [<ffffffffa039d99b>] ismt_access+0x27b/0x8fa [i2c_ismt]
 [<ffffffff81554420>] ? __pm_runtime_suspend+0xa0/0xa0
 [<ffffffff815544a0>] ? pm_suspend_timer_fn+0x80/0x80
 [<ffffffff81554420>] ? __pm_runtime_suspend+0xa0/0xa0
 [<ffffffff815544a0>] ? pm_suspend_timer_fn+0x80/0x80
 [<ffffffff8143dfd0>] ? pci_bus_read_dev_vendor_id+0xf0/0xf0
 [<ffffffff8172b36c>] i2c_smbus_xfer+0xec/0x4b0
 [<ffffffff810aa4d5>] ? vprintk_emit+0x345/0x530
 [<ffffffffa038936b>] i2cdev_ioctl_smbus+0x12b/0x240 [i2c_dev]
 [<ffffffff810aa829>] ? vprintk_default+0x29/0x40
 [<ffffffffa0389b33>] i2cdev_ioctl+0x63/0x1ec [i2c_dev]
 [<ffffffff811b04c8>] do_vfs_ioctl+0x328/0x5d0
 [<ffffffff8119d8ec>] ? vfs_write+0x11c/0x190
 [<ffffffff8109d449>] ? rt_up_read+0x19/0x20
 [<ffffffff811b07f1>] SyS_ioctl+0x81/0xa0
 [<ffffffff819a351b>] system_call_fastpath+0x16/0x6e

This happen When run "i2cdetect -y 0" detect SMBus iSMT adapter.

After finished I2C block read/write, when unmap the data buffer,
a wrong device address was pass to dma_unmap_single().

To fix this, give dma_unmap_single() the "dev" parameter, just like
what dma_map_single() does, then unmap can find the right devices.

Fixes: 13f35ac14c ("i2c: Adding support for Intel iSMT SMBus 2.0 host controller")
Signed-off-by: Liwei Song <liwei.song@windriver.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2017-06-15 16:07:03 +02:00
..
i2c-acorn.c
i2c-ali15x3.c
i2c-ali1535.c
i2c-ali1563.c
i2c-amd756-s4882.c
i2c-amd756.c
i2c-amd8111.c
i2c-at91.c
i2c-au1550.c
i2c-axxia.c
i2c-bcm-iproc.c
i2c-bcm-kona.c
i2c-bcm2835.c
i2c-bfin-twi.c
i2c-brcmstb.c
i2c-cadence.c
i2c-cbus-gpio.c
i2c-cpm.c
i2c-cros-ec-tunnel.c
i2c-davinci.c
i2c-designware-baytrail.c
i2c-designware-core.c
i2c-designware-core.h
i2c-designware-pcidrv.c
i2c-designware-platdrv.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-gpio.c
i2c-highlander.c
i2c-hix5hd2.c
i2c-hydra.c
i2c-i801.c
i2c-ibm_iic.c
i2c-ibm_iic.h
i2c-img-scb.c
i2c-imx-lpi2c.c
i2c-imx.c
i2c-iop3xx.c
i2c-iop3xx.h
i2c-isch.c
i2c-ismt.c
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-ocores.c
i2c-octeon-core.c
i2c-octeon-core.h
i2c-octeon-platdrv.c
i2c-omap.c
i2c-opal.c
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-puv3.c
i2c-pxa-pci.c
i2c-pxa.c
i2c-qup.c
i2c-rcar.c
i2c-riic.c
i2c-rk3x.c
i2c-robotfuzz-osif.c
i2c-s3c2410.c
i2c-scmi.c
i2c-sh_mobile.c
i2c-sh7760.c
i2c-sibyte.c
i2c-simtec.c
i2c-sirf.c
i2c-sis96x.c
i2c-sis630.c
i2c-sis5595.c
i2c-st.c
i2c-stm32f4.c
i2c-stu300.c
i2c-sun6i-p2wi.c
i2c-taos-evm.c
i2c-tegra-bpmp.c
i2c-tegra.c
i2c-thunderx-pcidrv.c
i2c-tiny-usb.c
i2c-uniphier-f.c
i2c-uniphier.c
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
Kconfig
Makefile
scx200_acb.c