linux_dsm_epyc7002/drivers/ide
Finn Thain a4907c75b5 ide/falconide: Fix module unload
[ Upstream commit 07f1dc8cc85bbfb2f9270f25060c4755f4509f45 ]

Unloading the falconide module results in a crash:

Unable to handle kernel NULL pointer dereference at virtual address 00000000
Oops: 00000000
Modules linked in: falconide(-)
PC: [<002930b2>] ide_host_remove+0x2e/0x1d2
SR: 2000  SP: 00b49e28  a2: 009b0f90
d0: 00000000    d1: 009b0f90    d2: 00000000    d3: 00b48000
d4: 003cef32    d5: 00299188    a0: 0086d000    a1: 0086d000
Process rmmod (pid: 322, task=009b0f90)
Frame format=7 eff addr=00000000 ssw=0505 faddr=00000000
wb 1 stat/addr/data: 0000 00000000 00000000
wb 2 stat/addr/data: 0000 00000000 00000000
wb 3 stat/addr/data: 0000 00000000 00018da9
push data: 00000000 00000000 00000000 00000000
Stack from 00b49e90:
        004c456a 0027f176 0027cb0a 0027cb9e 00000000 0086d00a 2187d3f0 0027f0e0
        00b49ebc 2187d1f6 00000000 00b49ec8 002811e8 0086d000 00b49ef0 0028024c
        0086d00a 002800d6 00279a1a 00000001 00000001 0086d00a 2187d3f0 00279a58
        00b49f1c 002802e0 0086d00a 2187d3f0 004c456a 0086d00a ef96af74 00000000
        2187d3f0 002805d2 800de064 00b49f44 0027f088 2187d3f0 00ac1cf4 2187d3f0
        004c43be 2187d3f0 00000000 2187d3f0 800b66a8 00b49f5c 00280776 2187d3f0
Call Trace: [<0027f176>] __device_driver_unlock+0x0/0x48
 [<0027cb0a>] device_links_busy+0x0/0x94
 [<0027cb9e>] device_links_unbind_consumers+0x0/0x130
 [<0027f0e0>] __device_driver_lock+0x0/0x5a
 [<2187d1f6>] falconide_remove+0x12/0x18 [falconide]
 [<002811e8>] platform_drv_remove+0x1c/0x28
 [<0028024c>] device_release_driver_internal+0x176/0x17c
 [<002800d6>] device_release_driver_internal+0x0/0x17c
 [<00279a1a>] get_device+0x0/0x22
 [<00279a58>] put_device+0x0/0x18
 [<002802e0>] driver_detach+0x56/0x82
 [<002805d2>] driver_remove_file+0x0/0x24
 [<0027f088>] bus_remove_driver+0x4c/0xa4
 [<00280776>] driver_unregister+0x28/0x5a
 [<00281a00>] platform_driver_unregister+0x12/0x18
 [<2187d2a0>] ide_falcon_driver_exit+0x10/0x16 [falconide]
 [<000764f0>] sys_delete_module+0x110/0x1f2
 [<000e83ea>] sys_rename+0x1a/0x1e
 [<00002e0c>] syscall+0x8/0xc
 [<00188004>] ext4_multi_mount_protect+0x35a/0x3ce
Code: 0029 9188 4bf9 0027 aa1c 283c 003c ef32 <265c> 4a8b 6700 00b8 2043 2028 000c 0280 00ff ff00 6600 0176 40c0 7202 b2b9 004c
Disabling lock debugging due to kernel taint

This happens because the driver_data pointer is uninitialized.
Add the missing platform_set_drvdata() call. For clarity, use the
matching platform_get_drvdata() as well.

Cc: Michael Schmitz <schmitzmic@gmail.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Fixes: 5ed0794cde ("m68k/atari: Convert Falcon IDE drivers to platform drivers")
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-04 11:38:21 +01:00
..
aec62xx.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
ali14xx.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
alim15x3.c
amd74xx.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
atiixp.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
buddha.c
cmd64x.c cmd64x: potential buffer overflow in cmd64x_program_timings() 2020-01-20 13:38:27 +01:00
cmd640.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
cs5520.c
cs5530.c
cs5535.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
cs5536.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333 2019-06-05 17:37:06 +02:00
cy82c693.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
delkin_cb.c
dtc2278.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
falconide.c ide/falconide: Fix module unload 2021-03-04 11:38:21 +01:00
gayle.c
hpt366.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
ht6560b.c ide: ht6560b: Fix cast to pointer from integer of different size 2020-01-20 13:38:26 +01:00
icside.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
ide_platform.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ide-4drives.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
ide-acpi.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
ide-atapi.c scsi: ide: Do not set the RQF_PREEMPT flag for sense requests 2021-01-12 20:18:15 +01:00
ide-cd_ioctl.c Revert "ide: unexport DISK_EVENT_MEDIA_CHANGE for ide-gd and ide-cd" 2019-04-12 13:35:25 -06:00
ide-cd_verbose.c
ide-cd.c ide-cd: remove idecd_revalidate_disk 2020-09-10 09:32:31 -06:00
ide-cd.h
ide-cs.c
ide-devsets.c
ide-disk_ioctl.c
ide-disk_proc.c
ide-disk.c ide-gd: stop using the disk events mechanism 2020-09-10 09:32:31 -06:00
ide-disk.h
ide-dma-sff.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
ide-dma.c
ide-eh.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
ide-floppy_ioctl.c compat_ioctl: move HDIO ioctl handling into drivers/ide 2020-01-03 09:42:52 +01:00
ide-floppy_proc.c
ide-floppy.c ide-gd: stop using the disk events mechanism 2020-09-10 09:32:31 -06:00
ide-floppy.h compat_ioctl: ide: floppy: add handler 2020-01-03 09:33:24 +01:00
ide-gd.c block: move the NEED_PART_SCAN flag to struct gendisk 2020-09-23 10:43:18 -06:00
ide-gd.h
ide-generic.c
ide-io-std.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
ide-io.c scsi: ide: Mark power management requests with RQF_PM instead of RQF_PREEMPT 2021-01-12 20:18:15 +01:00
ide-ioctls.c block: add a bdev_is_partition helper 2020-09-25 08:18:57 -06:00
ide-iops.c ide: remove unnecessary touch_softlockup_watchdog 2020-01-20 13:38:26 +01:00
ide-legacy.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
ide-lib.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
ide-park.c ide: ensure atapi sense request aren't preempted 2019-01-31 08:25:09 -07:00
ide-pci-generic.c
ide-pio-blacklist.c
ide-pm.c scsi: ide: Mark power management requests with RQF_PM instead of RQF_PREEMPT 2021-01-12 20:18:15 +01:00
ide-pnp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 47 2019-05-24 17:27:13 +02:00
ide-probe.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
ide-proc.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
ide-scan-pci.c drivers/ide: Fix build regression. 2020-04-04 18:07:59 -07:00
ide-sysfs.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
ide-tape.c compat_ioctl: move HDIO ioctl handling into drivers/ide 2020-01-03 09:42:52 +01:00
ide-taskfile.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
ide-timings.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
ide-xfer-mode.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
ide.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
it821x.c
it8172.c
it8213.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
jmicron.c
Kconfig ide/macide: Convert Mac IDE driver to platform driver 2020-09-28 10:48:17 +02:00
macide.c ide/macide: Convert Mac IDE driver to platform driver 2020-09-28 10:48:17 +02:00
Makefile ide: remove no longer used au1xxx-ide driver 2020-03-24 15:53:38 +01:00
ns87415.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
opti621.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
palm_bk3710.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
pdc202xx_new.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
pdc202xx_old.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
piix.c
pmac.c ide: remove set but not used variable 'hwif' 2020-01-20 13:38:26 +01:00
q40ide.c
qd65xx.c ide: qd65xx: Fix cast to pointer from integer of different size 2020-01-20 13:38:27 +01:00
qd65xx.h
rapide.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
rz1000.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
sc1200.c
serverworks.c ide: serverworks: potential overflow in svwks_set_pio_mode() 2020-01-20 13:38:27 +01:00
setup-pci.c
siimage.c ide: Use dev_get_drvdata where possible 2019-07-23 13:04:54 -07:00
sis5513.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
sl82c105.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
slc90e66.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
tc86c001.c
triflex.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333 2019-06-05 17:37:06 +02:00
trm290.c
tx4938ide.c ide: Use pr_warn instead of pr_warning 2019-10-18 15:00:21 +02:00
tx4939ide.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide 2020-01-30 07:39:10 -08:00
umc8672.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00
via82cxxx.c ide: Use dev_get_drvdata where possible 2019-07-23 13:04:54 -07:00