• Larry Finger's avatar
    powerpc/pmac: Fix crash in dma-mapping.h with NULL dma_ops · 46f401c4
    Larry Finger authored
    Commit 5657933d ("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 5657933d the
    dma_ops are moved into dev->ofdev.dev, and so they need to be explicitly
    copied.
    
    Fixes: 5657933d ("treewide: Move dma_ops from struct dev_archdata into struct device")
    Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
    Suggested-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    [mpe: Rewrite change log, add backtrace]
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    46f401c4
Name
Last commit
Last update
..
ams Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
adb-iop.c Loading commit data...
adb.c Loading commit data...
adbhid.c Loading commit data...
ans-lcd.c Loading commit data...
ans-lcd.h Loading commit data...
apm_emu.c Loading commit data...
mac_hid.c Loading commit data...
macio-adb.c Loading commit data...
macio_asic.c Loading commit data...
macio_sysfs.c Loading commit data...
mediabay.c Loading commit data...
rack-meter.c Loading commit data...
smu.c Loading commit data...
therm_adt746x.c Loading commit data...
therm_windtunnel.c Loading commit data...
via-cuda.c Loading commit data...
via-macii.c Loading commit data...
via-pmu-backlight.c Loading commit data...
via-pmu-event.c Loading commit data...
via-pmu-event.h Loading commit data...
via-pmu-led.c Loading commit data...
via-pmu.c Loading commit data...
via-pmu68k.c Loading commit data...
windfarm.h Loading commit data...
windfarm_ad7417_sensor.c Loading commit data...
windfarm_core.c Loading commit data...
windfarm_cpufreq_clamp.c Loading commit data...
windfarm_fcu_controls.c Loading commit data...
windfarm_lm75_sensor.c Loading commit data...
windfarm_lm87_sensor.c Loading commit data...
windfarm_max6690_sensor.c Loading commit data...
windfarm_mpu.h Loading commit data...
windfarm_pid.c Loading commit data...
windfarm_pid.h Loading commit data...
windfarm_pm112.c Loading commit data...
windfarm_pm121.c Loading commit data...
windfarm_pm72.c Loading commit data...
windfarm_pm81.c Loading commit data...
windfarm_pm91.c Loading commit data...
windfarm_rm31.c Loading commit data...
windfarm_smu_controls.c Loading commit data...
windfarm_smu_sat.c Loading commit data...
windfarm_smu_sensors.c Loading commit data...