linux-sg2042/drivers/macintosh
Larry Finger 46f401c429 powerpc/pmac: Fix crash in dma-mapping.h with NULL dma_ops
Commit 5657933dbb ("treewide: Move dma_ops from struct dev_archdata
into struct device") introduced a crash for macio devices, an example
backtrace being:

  kernel BUG at ./include/linux/dma-mapping.h:465!
  Oops: Exception in kernel mode, sig: 5 [#1]
  ...
  NIP [c031ddb0] dmam_alloc_coherent+0x74/0x140
  LR [c031de70] dmam_alloc_coherent+0x134/0x140
  Call Trace:
   dmam_alloc_coherent+0x134/0x140 (unreliable)
   pata_macio_port_start+0x3c/0x8c
   ata_host_start.part.5+0xfc/0x208
   ata_host_activate+0x128/0x154
   pata_macio_common_init+0x2f0/0x538
   pata_macio_attach+0xd8/0x180
   macio_device_probe+0x5c/0xec
   driver_probe_device+0x21c/0x314
   __driver_attach+0xcc/0xd0
   bus_for_each_dev+0x68/0xb4
   bus_add_driver+0x1dc/0x244
   driver_register+0x88/0x130
   pata_macio_init+0x5c/0x88
   do_one_initcall+0x40/0x170
   kernel_init_freeable+0x134/0x1d0
   kernel_init+0x18/0x110
   ret_from_kernel_thread+0x5c/0x64

This was caused by the device having NULL dma_ops, triggering the
BUG_ON(). Previously the device inherited its dma_ops via the assignment
to dev->ofdev.dev.archdata. However after commit 5657933dbb the
dma_ops are moved into dev->ofdev.dev, and so they need to be explicitly
copied.

Fixes: 5657933dbb ("treewide: Move dma_ops from struct dev_archdata into struct device")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[mpe: Rewrite change log, add backtrace]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2017-03-10 14:17:23 +11:00
..
ams drivers/macintosh: Delete owner assignment 2016-08-22 11:09:33 +10:00
Kconfig m68k/mac: Replace via-maciisi driver with via-cuda driver 2017-02-07 16:56:25 +11:00
Makefile m68k/mac: Replace via-maciisi driver with via-cuda driver 2017-02-07 16:56:25 +11:00
adb-iop.c drivers/macintosh/adb-iop.c: flags should be unsigned long 2010-11-12 07:55:30 -08:00
adb.c sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
adbhid.c Fix common misspellings 2011-03-31 11:26:23 -03:00
ans-lcd.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
ans-lcd.h
apm_emu.c
mac_hid.c macintosh: Convert use of typedef ctl_table to struct ctl_table 2013-07-01 11:10:35 +10:00
macio-adb.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
macio_asic.c powerpc/pmac: Fix crash in dma-mapping.h with NULL dma_ops 2017-03-10 14:17:23 +11:00
macio_sysfs.c
mediabay.c Drivers: macintosh: remove __dev* attributes. 2013-01-03 15:57:14 -08:00
rack-meter.c macintosh/rack-meter: Convert cputime64_t use to u64 2017-02-01 09:13:47 +01:00
smu.c sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
therm_adt746x.c powerpc/pmac: Convert therm_adt746x to new i2c probing 2012-04-30 15:37:18 +10:00
therm_windtunnel.c macintosh/therm_windtunnel: Export OF module alias information 2015-08-20 16:15:20 +10:00
via-cuda.c m68k/mac: Replace via-maciisi driver with via-cuda driver 2017-02-07 16:56:25 +11:00
via-macii.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
via-pmu-backlight.c backlight: Remove trivial get_brightness implementations 2014-06-23 13:24:22 +01:00
via-pmu-event.c
via-pmu-event.h
via-pmu-led.c powerpc: use the new LED disk activity trigger 2016-06-27 08:58:40 +02:00
via-pmu.c sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
via-pmu68k.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
windfarm.h windfarm: remove three exported but unused functions 2015-08-06 15:10:21 +10:00
windfarm_ad7417_sensor.c Drivers: macintosh: remove __dev* attributes. 2013-01-03 15:57:14 -08:00
windfarm_core.c Make static usermode helper binaries constant 2017-01-19 12:59:45 +01:00
windfarm_cpufreq_clamp.c powerpc/powermac: New windfarm driver for PowerMac G5 (AGP) and Xserve G5 2012-04-30 15:37:25 +10:00
windfarm_fcu_controls.c Drivers: macintosh: remove __dev* attributes. 2013-01-03 15:57:14 -08:00
windfarm_lm75_sensor.c powerpc/windfarm: Remove superfluous name casts 2013-12-05 16:06:22 +11:00
windfarm_lm87_sensor.c powerpc/windfarm: Add lm87 sensor 2012-04-30 15:37:21 +10:00
windfarm_max6690_sensor.c powerpc/windfarm: Remove superfluous name casts 2013-12-05 16:06:22 +11:00
windfarm_mpu.h powerpc/powermac: New windfarm driver for PowerMac G5 (AGP) and Xserve G5 2012-04-30 15:37:25 +10:00
windfarm_pid.c
windfarm_pid.h
windfarm_pm72.c drivers/macintosh: Delete owner assignment 2016-08-22 11:09:33 +10:00
windfarm_pm81.c macintosh: drop owner assignment from platform_drivers 2014-10-20 16:20:43 +02:00
windfarm_pm91.c macintosh: drop owner assignment from platform_drivers 2014-10-20 16:20:43 +02:00
windfarm_pm112.c drivers/macintosh: Delete owner assignment 2016-08-22 11:09:33 +10:00
windfarm_pm121.c macintosh/windfarm_pm121.c: Fix for possible null pointer dereference 2014-05-20 10:56:00 +10:00
windfarm_rm31.c drivers/macintosh: Delete owner assignment 2016-08-22 11:09:33 +10:00
windfarm_smu_controls.c powerpc/windfarm: Remove spurrious sysfs_attr_init() 2012-04-30 15:37:20 +10:00
windfarm_smu_sat.c macintosh/windfarm: Remove obsolete cleanup for clientdata 2013-07-01 11:46:56 +10:00
windfarm_smu_sensors.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00