linux-stable/drivers
Maciej W. Rozycki e7f6b41ad2 TC: Set DMA masks for devices
commit 3f2aa244ee upstream.

Fix a TURBOchannel support regression with commit 205e1b7f51
("dma-mapping: warn when there is no coherent_dma_mask") that caused
coherent DMA allocations to produce a warning such as:

defxx: v1.11 2014/07/01  Lawrence V. Stefani and others
tc1: DEFTA at MMIO addr = 0x1e900000, IRQ = 20, Hardware addr = 08-00-2b-a3-a3-29
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 dfx_dev_register+0x670/0x678
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.0-rc6 #2
Stack : ffffffff8009ffc0 fffffffffffffec0 0000000000000000 ffffffff80647650
        0000000000000000 0000000000000000 ffffffff806f5f80 ffffffffffffffff
        0000000000000000 0000000000000000 0000000000000001 ffffffff8065d4e8
        98000000031b6300 ffffffff80563478 ffffffff805685b0 ffffffffffffffff
        0000000000000000 ffffffff805d6720 0000000000000204 ffffffff80388df8
        0000000000000000 0000000000000009 ffffffff8053efd0 ffffffff806657d0
        0000000000000000 ffffffff803177f8 0000000000000000 ffffffff806d0000
        9800000003078000 980000000307b9e0 000000001e900000 ffffffff80067940
        0000000000000000 ffffffff805d6720 0000000000000204 ffffffff80388df8
        ffffffff805176c0 ffffffff8004dc78 0000000000000000 ffffffff80067940
        ...
Call Trace:
[<ffffffff8004dc78>] show_stack+0xa0/0x130
[<ffffffff80067940>] __warn+0x128/0x170
---[ end trace b1d1e094f67f3bb2 ]---

This is because the TURBOchannel bus driver fails to set the coherent
DMA mask for devices enumerated.

Set the regular and coherent DMA masks for TURBOchannel devices then,
observing that the bus protocol supports a 34-bit (16GiB) DMA address
space, by interpreting the value presented in the address cycle across
the 32 `ad' lines as a 32-bit word rather than byte address[1].  The
architectural size of the TURBOchannel DMA address space exceeds the
maximum amount of RAM any actual TURBOchannel system in existence may
have, hence both masks are the same.

This removes the warning shown above.

References:

[1] "TURBOchannel Hardware Specification", EK-369AA-OD-007B, Digital
    Equipment Corporation, January 1993, Section "DMA", pp. 1-15 -- 1-17

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/20835/
Fixes: 205e1b7f51 ("dma-mapping: warn when there is no coherent_dma_mask")
Cc: stable@vger.kernel.org # 4.16+
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-13 11:15:11 -08:00
..
accessibility
acpi ACPI / LPSS: Add alternative ACPI HIDs for Cherry Trail DMA controllers 2018-11-13 11:14:55 -08:00
amba
android android: binder: fix the race mmap and alloc_new_buf_locked 2018-09-19 22:43:35 +02:00
ata ata: ftide010: Add a quirk for SQ201 2018-10-03 17:00:59 -07:00
atm atm: zatm: Fix potential Spectre v1 2018-07-22 14:28:43 +02:00
auxdisplay auxdisplay: fix broken menu 2018-07-03 11:24:56 +02:00
base PM / core: Clear the direct_complete flag on errors 2018-10-13 09:27:25 +02:00
bcma
block xen/blkfront: avoid NULL blkfront_info dereference on device removal 2018-11-13 11:15:02 -08:00
bluetooth Bluetooth: btbcm: Add entry for BCM4335C0 UART bluetooth 2018-11-13 11:14:54 -08:00
bus drivers/perf: arm-ccn: don't log to dmesg in event_init 2018-08-03 07:50:31 +02:00
cdrom cdrom: Fix info leak/OOB read in cdrom_ioctl_drive_status 2018-09-05 09:26:42 +02:00
char tpm: Restore functionality to xen vtpm driver. 2018-11-13 11:15:02 -08:00
clk clk: x86: Stop marking clocks as CLK_IS_CRITICAL 2018-10-18 09:16:22 +02:00
clocksource clocksource/drivers/fttmr010: Fix set_next_event handler 2018-10-20 09:48:52 +02:00
connector
cpufreq cpufreq: dt: Try freeing static OPPs only if we have added them 2018-11-13 11:14:54 -08:00
cpuidle cpuidle: powernv: Fix promotion from snooze if next state disabled 2018-07-03 11:24:51 +02:00
crypto crypto: caam - fix implicit casts in endianness helpers 2018-11-13 11:14:59 -08:00
dax dev-dax: check_vma: ratelimit dev_info-s 2018-08-24 13:09:08 +02:00
dca
devfreq
dio
dma dmaengine: stm32-dma: fix incomplete configuration in cyclic mode 2018-11-13 11:15:05 -08:00
dma-buf
edac EDAC, skx_edac: Fix logical channel intermediate decoding 2018-11-13 11:15:06 -08:00
eisa
extcon extcon: Release locking when sending the notification of connector state 2018-09-09 19:55:56 +02:00
firewire
firmware efi/esrt: Only call efi_mem_reserve() for boot services memory 2018-09-26 08:38:10 +02:00
fmc
fpga
fsi
gpio gpio: mxs: Get rid of external API call 2018-11-10 07:48:34 -08:00
gpu drm: fb-helper: Reject all pixel format changing requests 2018-11-10 07:48:35 -08:00
hid HID: hiddev: fix potential Spectre v1 2018-11-13 11:15:06 -08:00
hsi
hv Drivers: hv: vmbus: Use cpumask_var_t for on-stack cpu mask 2018-11-13 11:14:58 -08:00
hwmon hwmon: (pwm-fan) Set fan speed to 0 on suspend 2018-11-13 11:14:52 -08:00
hwspinlock
hwtracing coresight: etb10: Fix handling of perf mode 2018-11-13 11:14:59 -08:00
i2c i2c: rcar: cleanup DMA for all kinds of failure 2018-11-13 11:14:51 -08:00
ide
idle intel_idle: Graceful probe failure when MWAIT is disabled 2018-08-09 12:16:39 +02:00
iio iio: adc: at91: fix wrong channel number in triggered buffer mode 2018-11-13 11:15:09 -08:00
infiniband IB/mlx5: Fix MR cache initialization 2018-11-13 11:15:05 -08:00
input Input: elan_i2c - add ACPI ID for Lenovo IdeaPad 330-15IGM 2018-11-10 07:48:36 -08:00
iommu iommu/arm-smmu: Ensure that page-table updates are visible before TLBI 2018-11-13 11:15:10 -08:00
ipack
irqchip irqchip/bcm7038-l1: Hide cpu offline callback when building for !SMP 2018-09-15 09:45:29 +02:00
isdn isdn: Disable IIOCDBGVAR 2018-08-22 07:46:11 +02:00
leds
lightnvm lightnvm: pblk: fix two sleep-in-atomic-context bugs 2018-11-13 11:14:52 -08:00
macintosh macintosh/via-pmu: Add missing mmio accessors 2018-09-19 22:43:41 +02:00
mailbox mailbox: xgene-slimpro: Fix potential NULL pointer dereference 2018-09-09 19:55:54 +02:00
mcb
md dm zoned: fix various dmz_get_mblock() issues 2018-11-13 11:15:10 -08:00
media media: uvcvideo: Fix driver reference counting 2018-11-04 14:52:47 +01:00
memory memory: tegra: Apply interrupts mask per SoC 2018-08-03 07:50:38 +02:00
memstick
message
mfd mfd: menelaus: Fix possible race condition and leak 2018-11-13 11:15:00 -08:00
misc signal/GenWQE: Fix sending of SIGKILL 2018-11-13 11:15:07 -08:00
mmc mmc: sdhci-pci-o2micro: Add quirk for O2 Micro dev 0x8620 rev 0x01 2018-11-13 11:14:53 -08:00
mtd mtd: rawnand: atmel: Fix potential NULL pointer dereference 2018-11-13 11:14:54 -08:00
mux
net iwlwifi: mvm: check return value of rs_rate_from_ucode_rate() 2018-11-13 11:15:04 -08:00
nfc NFC: pn533: Fix wrong GFP flag usage 2018-08-24 13:09:06 +02:00
ntb
nubus
nvdimm libnvdimm, region: Fail badblocks listing for inactive regions 2018-11-13 11:15:05 -08:00
nvme nvme_fc: fix ctrl create failures racing with workq items 2018-10-13 09:27:28 +02:00
nvmem nvmem: Don't let a NULL cell_id for nvmem_cell_get() crash us 2018-08-24 13:09:14 +02:00
of of: unittest: Disable interrupt node tests for old world MAC systems 2018-10-13 09:27:27 +02:00
oprofile
parisc
parport parport: sunbpp: fix error return code 2018-09-26 08:38:12 +02:00
pci PCI: vmd: White list for fast interrupt handlers 2018-11-13 11:15:07 -08:00
pcmcia pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges 2018-11-13 11:14:46 -08:00
perf arm64: perf: Reject stand-alone CHAIN events for PMUv3 2018-10-18 09:16:24 +02:00
phy phy: phy-mtk-tphy: use auto instead of force to bypass utmi signals 2018-08-15 18:12:48 +02:00
pinctrl pinctrl: ssbi-gpio: Fix pm8xxx_pin_config_get() to be compliant 2018-11-13 11:14:56 -08:00
platform platform/x86: alienware-wmi: Correct a memory leak 2018-09-29 03:06:03 -07:00
pnp
power power: remove possible deadlock when unregistering power_supply 2018-10-03 17:00:47 -07:00
powercap
pps
ps3
ptp ptp: fix Spectre v1 vulnerability 2018-11-10 07:48:34 -08:00
pwm pwm: meson: Fix mux clock names 2018-09-15 09:45:27 +02:00
rapidio
ras
regulator regulator: fix crash caused by null driver data 2018-10-03 17:00:55 -07:00
remoteproc remoteproc: qcom: Fix potential device node leaks 2018-06-21 04:02:48 +09:00
reset reset: imx7: Fix always writing bits as 0 2018-09-26 08:38:03 +02:00
rpmsg Revert "rpmsg: core: add support to power domains for devices" 2018-09-29 03:06:04 -07:00
rtc rtc: bq4802: add error handling for devm_ioremap 2018-09-26 08:38:13 +02:00
s390 s390/qeth: fix error handling in adapter command callbacks 2018-11-04 14:52:42 +01:00
sbus
scsi scsi: lpfc: Correct race with abort on completion path 2018-11-13 11:15:00 -08:00
sfi
sh
sn
soc soc: fsl: qe: Fix copy/paste bug in ucc_get_tdm_sync_shift() 2018-11-04 14:52:38 +01:00
spi spi: spi-ep93xx: Use dma_data_direction for ep93xx_spi_dma_{finish,prepare} 2018-11-13 11:14:52 -08:00
spmi
ssb
staging staging: ccree: check DMA pool buf !NULL before free 2018-10-20 09:48:53 +02:00
target scsi: iscsi: target: Don't use stack buffer for scatterlist 2018-10-18 09:16:21 +02:00
tc TC: Set DMA masks for devices 2018-11-13 11:15:11 -08:00
tee tee: check shm references are consistent in offset/size 2018-06-21 04:02:54 +09:00
thermal thermal: da9062/61: Prevent hardware access during system suspend 2018-11-13 11:14:56 -08:00
thunderbolt
tty tty: Drop tty->count on tty_reopen() failure 2018-10-13 09:27:26 +02:00
uio uio: ensure class is registered before devices 2018-11-13 11:14:59 -08:00
usb usb: gadget: udc: renesas_usb3: Fix b-device mode for "workaround" 2018-11-13 11:15:04 -08:00
uwb uwb: hwa-rc: fix memory leak at probe 2018-10-03 17:00:46 -07:00
vfio vfio/type1: Fix task tracking for QEMU vCPU hotplug 2018-08-03 07:50:23 +02:00
vhost vhost: Fix Spectre V1 vulnerability 2018-11-04 14:52:49 +01:00
video pxa168fb: prepare the clock 2018-11-04 14:52:39 +01:00
virt
virtio virtio_balloon: fix increment of vb->num_pfns in fill_balloon() 2018-10-13 09:27:30 +02:00
vlynq
vme
w1 w1: omap-hdq: fix missing bus unregister at removal 2018-11-13 11:15:09 -08:00
watchdog watchdog: da9063: Fix updating timeout value 2018-08-03 07:50:24 +02:00
xen xen/balloon: Support xend-based toolstack 2018-11-13 11:15:02 -08:00
zorro
Kconfig
Makefile