linux/drivers/media/i2c
Laurentiu Palcu 365ab7ebc2 media: i2c: max9286: fix kernel oops when removing module
When removing the max9286 module we get a kernel oops:

Unable to handle kernel paging request at virtual address 000000aa00000094
Mem abort info:
  ESR = 0x96000004
  EC = 0x25: DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
  FSC = 0x04: level 0 translation fault
Data abort info:
  ISV = 0, ISS = 0x00000004
  CM = 0, WnR = 0
user pgtable: 4k pages, 48-bit VAs, pgdp=0000000880d85000
[000000aa00000094] pgd=0000000000000000, p4d=0000000000000000
Internal error: Oops: 96000004 [#1] PREEMPT SMP
Modules linked in: fsl_jr_uio caam_jr rng_core libdes caamkeyblob_desc caamhash_desc caamalg_desc crypto_engine max9271 authenc crct10dif_ce mxc_jpeg_encdec
CPU: 2 PID: 713 Comm: rmmod Tainted: G         C        5.15.5-00057-gaebcd29c8ed7-dirty #5
Hardware name: Freescale i.MX8QXP MEK (DT)
pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : i2c_mux_del_adapters+0x24/0xf0
lr : max9286_remove+0x28/0xd0 [max9286]
sp : ffff800013a9bbf0
x29: ffff800013a9bbf0 x28: ffff00080b6da940 x27: 0000000000000000
x26: 0000000000000000 x25: 0000000000000000 x24: 0000000000000000
x23: ffff000801a5b970 x22: ffff0008048b0890 x21: ffff800009297000
x20: ffff0008048b0f70 x19: 000000aa00000064 x18: 0000000000000000
x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
x14: 0000000000000014 x13: 0000000000000000 x12: ffff000802da49e8
x11: ffff000802051918 x10: ffff000802da4920 x9 : ffff000800030098
x8 : 0101010101010101 x7 : 7f7f7f7f7f7f7f7f x6 : fefefeff6364626d
x5 : 8080808000000000 x4 : 0000000000000000 x3 : 0000000000000000
x2 : ffffffffffffffff x1 : ffff00080b6da940 x0 : 0000000000000000
Call trace:
 i2c_mux_del_adapters+0x24/0xf0
 max9286_remove+0x28/0xd0 [max9286]
 i2c_device_remove+0x40/0x110
 __device_release_driver+0x188/0x234
 driver_detach+0xc4/0x150
 bus_remove_driver+0x60/0xe0
 driver_unregister+0x34/0x64
 i2c_del_driver+0x58/0xa0
 max9286_i2c_driver_exit+0x1c/0x490 [max9286]
 __arm64_sys_delete_module+0x194/0x260
 invoke_syscall+0x48/0x114
 el0_svc_common.constprop.0+0xd4/0xfc
 do_el0_svc+0x2c/0x94
 el0_svc+0x28/0x80
 el0t_64_sync_handler+0xa8/0x130
 el0t_64_sync+0x1a0/0x1a4

The Oops happens because the I2C client data does not point to
max9286_priv anymore but to v4l2_subdev. The change happened in
max9286_init() which calls v4l2_i2c_subdev_init() later on...

Besides fixing the max9286_remove() function, remove the call to
i2c_set_clientdata() in max9286_probe(), to avoid confusion, and make
the necessary changes to max9286_init() so that it doesn't have to use
i2c_get_clientdata() in order to fetch the pointer to priv.

Fixes: 66d8c9d242 ("media: i2c: Add MAX9286 driver")
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-04-24 08:11:21 +01:00
..
adv748x media: v4l2-mediabus: Use structures to describe bus configuration 2022-02-17 09:51:23 +01:00
ccs media: ccs: Use unsigned int as index to an array 2022-04-24 08:01:06 +01:00
cx25840 media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
et8ek8 media: Kconfig: cleanup VIDEO_DEV dependencies 2022-03-18 05:58:35 +01:00
m5mols media: m5mols/m5mols.h: document new reset field 2022-03-18 07:27:56 +01:00
s5c73m3 media: s5c73m3: Drop empty spi_driver remove callback 2021-11-30 12:07:06 +01:00
ad5820.c media: i2c: ad5820: simplify getting state container 2020-11-16 10:31:11 +01:00
ad9389b.c
adp1653.c media: i2c: adp1653: simplify getting state container 2020-11-16 10:31:11 +01:00
adv7170.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
adv7175.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
adv7180.c media: v4l2-mediabus: Drop V4L2_MBUS_CSI2_CONTINUOUS_CLOCK flag 2022-02-17 09:54:26 +01:00
adv7183_regs.h
adv7183.c media: adv7183: Convert to GPIO descriptors 2022-03-04 09:36:27 +02:00
adv7343_regs.h
adv7343.c
adv7393_regs.h
adv7393.c
adv7511-v4l2.c media: adv7511: Drop unused include 2022-03-04 09:36:25 +02:00
adv7604.c media: video/hdmi: handle short reads of hdmi info frame. 2022-02-16 12:48:23 +01:00
adv7842.c media: video/hdmi: handle short reads of hdmi info frame. 2022-02-16 12:48:23 +01:00
ak881x.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
ak7375.c media: i2c: ak7375: use pm_runtime_resume_and_get() 2021-05-19 09:51:40 +02:00
aptina-pll.c
aptina-pll.h
bt819.c
bt856.c
bt866.c
ccs-pll.c Linux 5.11-rc6 2021-02-01 10:03:45 +01:00
ccs-pll.h media: ccs-pll: Switch from standard integer types to kernel ones 2021-01-12 17:55:28 +01:00
cs53l32a.c
cs3308.c
cs5345.c
dw9714.c media: i2c: dw9714: add optional regulator support 2022-01-28 19:32:49 +01:00
dw9768.c media: dw9768: activate runtime PM and turn off device 2021-11-15 08:11:34 +00:00
dw9807-vcm.c media: i2c: dw9807-vcm: use pm_runtime_resume_and_get() 2021-05-19 09:51:40 +02:00
hi556.c media: hi556: Support device probe in non-zero ACPI D state 2021-12-16 20:54:53 +01:00
hi846.c media: i2c: hi846: use pm_runtime_force_suspend/resume for system suspend 2021-12-16 20:54:53 +01:00
hi847.c media: hi847: Add support for Hi-847 sensor 2022-01-28 19:32:49 +01:00
imx208.c media: imx208: Support device probe in non-zero ACPI D state 2021-12-16 20:54:52 +01:00
imx214.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
imx219.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
imx258.c media: imx258: Fix getting clock frequency 2021-09-30 10:07:45 +02:00
imx274.c media: i2c: imx274: Drop surplus includes 2022-03-04 00:27:08 +02:00
imx290.c media: imx290: mark read reg function as __always_unused 2021-11-29 13:23:14 +01:00
imx319.c media: Update Intel-submitted camera sensor driver contacts 2021-12-16 20:54:51 +01:00
imx334.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
imx335.c media: i2c: Add imx335 camera sensor driver 2021-08-04 14:43:49 +02:00
imx355.c media: Update Intel-submitted camera sensor driver contacts 2021-12-16 20:54:51 +01:00
imx412.c media: i2c: Add imx412 camera sensor driver 2021-08-04 14:43:50 +02:00
ir-kbd-i2c.c media: ir-kbd-i2c: improve responsiveness of hauppauge zilog receivers 2021-09-30 10:08:00 +02:00
isl7998x.c media: i2c: isl7998x: Add driver for Intersil ISL7998x 2022-03-04 00:27:10 +02:00
Kconfig media: i2c: Kconfig: move camera drivers to the top 2022-03-18 05:58:35 +01:00
ks0127.c
ks0127.h
lm3560.c
lm3646.c
m52790.c
Makefile media: Makefiles: sort entries where it fits 2022-03-14 09:42:59 +01:00
max2175.c media: i2c: max2175: Use rbtree rather than flat register cache 2022-03-07 17:21:53 +01:00
max2175.h
max9271.c media: i2c: max9271: Introduce wake_up() function 2021-06-17 11:30:21 +02:00
max9271.h media: i2c: max9271: Introduce wake_up() function 2021-06-17 11:30:21 +02:00
max9286.c media: i2c: max9286: fix kernel oops when removing module 2022-04-24 08:11:21 +01:00
ml86v7667.c media: v4l2-mediabus: Use structures to describe bus configuration 2022-02-17 09:51:23 +01:00
msp3400-driver.c
msp3400-driver.h
msp3400-kthreads.c media: msp3400: use semicolons rather than commas to separate statements 2020-11-16 10:31:07 +01:00
mt9m001.c media: v4l2-mediabus: Use structures to describe bus configuration 2022-02-17 09:51:23 +01:00
mt9m032.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
mt9m111.c media: mt9m111: Drop unused include 2022-03-04 09:36:26 +02:00
mt9p031.c media: mt9p031: Use BIT macro 2021-09-30 10:07:35 +02:00
mt9t001.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
mt9t112.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
mt9v011.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
mt9v032.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
mt9v111.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
noon010pc30.c media: noon010p30: Convert to use GPIO descriptors 2022-03-04 09:36:26 +02:00
og01a1b.c media: Add a driver for the og01a1b camera sensor 2022-03-04 00:27:05 +02:00
ov02a10.c i2c/drivers/ov02q10: use HZ macros 2021-09-08 11:50:26 -07:00
ov08d10.c media: i2c: ov08d10: Unlock on error in ov08d10_enum_frame_size() 2022-02-17 10:00:21 +01:00
ov13b10.c media: Add sensor driver support for the ov13b10 camera. 2021-09-30 10:07:45 +02:00
ov772x.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
ov2640.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
ov2659.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
ov2680.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
ov2685.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
ov2740.c media: ov2740: identify module after subdev initialisation 2022-01-28 19:32:49 +01:00
ov5640.c media: ov5640: Fix set format, v4l2_mbus_pixelcode not updated 2022-02-23 12:21:39 +02:00
ov5645.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
ov5647.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
ov5648.c media: i2c: ov5648: Fix lockdep error 2022-03-04 00:27:05 +02:00
ov5670.c media: ov5670: Support device probe in non-zero ACPI D state 2021-12-16 20:54:52 +01:00
ov5675.c media: ov5675: use group write to update digital gain 2022-02-17 09:58:42 +01:00
ov5693.c media: ov5693: fix returnvar.cocci warnings 2022-01-28 19:32:49 +01:00
ov5695.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
ov6650.c media: v4l2-mediabus: Use structures to describe bus configuration 2022-02-17 09:51:23 +01:00
ov7251.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
ov7640.c
ov7670.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
ov7740.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
ov8856.c media: ov8856: support device probe in non-zero ACPI D state 2021-12-16 20:54:52 +01:00
ov8865.c media: i2c: Fix pixel array positions in ov8865 2022-03-04 09:36:28 +02:00
ov9282.c media: i2c: Add ov9282 camera sensor driver 2021-08-04 14:43:50 +02:00
ov9640.c media: v4l2-mediabus: Use structures to describe bus configuration 2022-02-17 09:51:23 +01:00
ov9640.h media: ov9640: Use the generic clock framework 2021-02-06 09:38:05 +01:00
ov9650.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
ov9734.c media: ov9734: use group write for digital gain 2021-08-04 14:43:51 +02:00
ov13858.c media: Update Intel-submitted camera sensor driver contacts 2021-12-16 20:54:51 +01:00
rdacm20.c media: i2c: rdacm20: Re-work ov10635 reset 2021-06-17 12:08:55 +02:00
rdacm21.c media: i2c: rdacm21: Power up OV10640 before OV490 2021-06-17 11:31:45 +02:00
rj54n1cb0c.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
s5k4ecgx.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
s5k5baf.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
s5k6a3.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
s5k6aa.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
saa711x_regs.h
saa717x.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
saa6588.c media: subdev: disallow ioctl for saa6588/davinci 2021-06-17 10:18:37 +02:00
saa6752hs.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
saa7110.c
saa7115.c media: saa7115: make static read-only array lcr2vbi const 2022-02-22 09:41:11 +01:00
saa7127.c
saa7185.c
sony-btf-mpx.c
sr030pc30.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
st-mipid02.c media: v4l: async: Rename async nf functions, clean up long lines 2021-09-30 10:07:35 +02:00
tc358743_regs.h
tc358743.c media: v4l2-mediabus: Drop V4L2_MBUS_CSI2_CONTINUOUS_CLOCK flag 2022-02-17 09:54:26 +01:00
tda1997x_regs.h media: TDA1997x: replace video detection routine 2021-10-19 08:08:38 +01:00
tda1997x.c media: TDA1997x: replace video detection routine 2021-10-19 08:08:38 +01:00
tda7432.c
tda9840.c
tea6415c.c
tea6415c.h
tea6420.c
tea6420.h
ths7303.c
ths8200_regs.h
ths8200.c
tlv320aic23b.c
tvaudio.c
tvp514x_regs.h media: media/i2c: fix kerneldoc issues for media i2c headers 2021-03-22 10:23:43 +01:00
tvp514x.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
tvp5150_reg.h
tvp5150.c media: v4l2-mediabus: Use structures to describe bus configuration 2022-02-17 09:51:23 +01:00
tvp7002_reg.h
tvp7002.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
tw2804.c
tw9903.c
tw9906.c
tw9910.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
uda1342.c
upd64031a.c
upd64083.c
video-i2c.c media: video-i2c: more precise intervals between frames 2021-09-30 10:07:57 +02:00
vp27smpx.c
vpx3220.c
vs6624_regs.h
vs6624.c media: v4l2-subdev: add subdev-wide state struct 2021-06-17 10:01:27 +02:00
wm8739.c
wm8775.c