Skip to contentSkip to conversation

drm/st7735r: Fix module autoloading for Okaya RH128128T

PATCH In review Javier Martinez Canillas 3 participants 4 messages May 20, 2022 – May 23, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/st7735r: Fix module autoloading for Okaya RH128128T

The SPI core always reports a "MODALIAS=spi:<foo>", even if the device was registered via OF. This means that the st7735r.ko module won't autoload if a DT has a node with a compatible "okaya,rh128128t" string.

In that case, kmod expects a "MODALIAS=of:N*T*Cokaya,rh128128t" uevent but instead will get a "MODALIAS=spi:rh128128t", which is not present in the list of aliases:

  $ modinfo drivers/gpu/drm/tiny/st7735r.ko | grep alias
  alias:          of:N*T*Cokaya,rh128128tC*
  alias:          of:N*T*Cokaya,rh128128t
  alias:          of:N*T*Cjianda,jd-t18003-t01C*
  alias:          of:N*T*Cjianda,jd-t18003-t01
  alias:          spi:jd-t18003-t01

To workaround this issue, add in the SPI table an entry for that device.

Fixes d1d511d516f7 ("drm: tiny: st7735r: Add support for Okaya RH128128T")

---

 drivers/gpu/drm/tiny/st7735r.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/tiny/st7735r.c +1 -0
index 29d618093e94..e0f02d367d88 100644
@@ -174,6 +174,7 @@ MODULE_DEVICE_TABLE(of, st7735r_of_match);
 
 static const struct spi_device_id st7735r_id[] = {
 	{ "jd-t18003-t01", (uintptr_t)&jd_t18003_t01_cfg },
+	{ "rh128128t", (uintptr_t)&rh128128t_cfg },
 	{ },
 };
 MODULE_DEVICE_TABLE(spi, st7735r_id);
Signature · 1 line
2.36.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Javier,

CC spi

Quoted 15 lines · Javier Martinez Canillas

The SPI core always reports a "MODALIAS=spi:<foo>", even if the device was registered via OF. This means that the st7735r.ko module won't autoload if a DT has a node with a compatible "okaya,rh128128t" string.

In that case, kmod expects a "MODALIAS=of:N*T*Cokaya,rh128128t" uevent but instead will get a "MODALIAS=spi:rh128128t", which is not present in the list of aliases:

  $ modinfo drivers/gpu/drm/tiny/st7735r.ko | grep alias
  alias:          of:N*T*Cokaya,rh128128tC*
  alias:          of:N*T*Cokaya,rh128128t
  alias:          of:N*T*Cjianda,jd-t18003-t01C*
  alias:          of:N*T*Cjianda,jd-t18003-t01
  alias:          spi:jd-t18003-t01
Quoted 4 lines

To workaround this issue, add in the SPI table an entry for that device.

Fixes d1d511d516f7 ("drm: tiny: st7735r: Add support for Okaya RH128128T")

Thanks for your patch!
We really need to fix this at the subsystem level.

drivers/gpu/drm/tiny/st7735r.c MODULE_DEVICE_TABLE(of, st7735r_of_match); · line 180

Quoted 10 lines
drivers/gpu/drm/tiny/st7735r.c +1 -0
@@ -174,6 +174,7 @@ MODULE_DEVICE_TABLE(of, st7735r_of_match);
 
 static const struct spi_device_id st7735r_id[] = {
        { "jd-t18003-t01", (uintptr_t)&jd_t18003_t01_cfg },
+       { "rh128128t", (uintptr_t)&rh128128t_cfg },
        { },
 };
 MODULE_DEVICE_TABLE(spi, st7735r_id);

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#2 lore raw

Hello Geert,

Quoted 21 lines · Geert Uytterhoeven

Hi Javier,

CC spi

Quoted 15 lines · Javier Martinez Canillas

The SPI core always reports a "MODALIAS=spi:<foo>", even if the device was registered via OF. This means that the st7735r.ko module won't autoload if a DT has a node with a compatible "okaya,rh128128t" string.

In that case, kmod expects a "MODALIAS=of:N*T*Cokaya,rh128128t" uevent but instead will get a "MODALIAS=spi:rh128128t", which is not present in the list of aliases:

  $ modinfo drivers/gpu/drm/tiny/st7735r.ko | grep alias
  alias:          of:N*T*Cokaya,rh128128tC*
  alias:          of:N*T*Cokaya,rh128128t
  alias:          of:N*T*Cjianda,jd-t18003-t01C*
  alias:          of:N*T*Cjianda,jd-t18003-t01
  alias:          spi:jd-t18003-t01
Quoted 8 lines
Quoted 4 lines

To workaround this issue, add in the SPI table an entry for that device.

Fixes d1d511d516f7 ("drm: tiny: st7735r: Add support for Okaya RH128128T")

Thanks for your patch!
We really need to fix this at the subsystem level.

Yes, agreed.

Quoted 2 lines

Thanks! I've pushed this to drm-misc (drm-misc-next) with your Reviewed-by and David's Acked-by.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat
Acked-by on v1 1/1
#3 lore raw
In reply to Javier Martinez Canillas
Quoted 15 lines · Javier Martinez Canillas

The SPI core always reports a "MODALIAS=spi:<foo>", even if the device was registered via OF. This means that the st7735r.ko module won't autoload if a DT has a node with a compatible "okaya,rh128128t" string.

In that case, kmod expects a "MODALIAS=of:N*T*Cokaya,rh128128t" uevent but instead will get a "MODALIAS=spi:rh128128t", which is not present in the list of aliases:

   $ modinfo drivers/gpu/drm/tiny/st7735r.ko | grep alias
   alias:          of:N*T*Cokaya,rh128128tC*
   alias:          of:N*T*Cokaya,rh128128t
   alias:          of:N*T*Cjianda,jd-t18003-t01C*
   alias:          of:N*T*Cjianda,jd-t18003-t01
   alias:          spi:jd-t18003-t01
Quoted 5 lines

To workaround this issue, add in the SPI table an entry for that device.

Fixes d1d511d516f7 ("drm: tiny: st7735r: Add support for Okaya RH128128T")

---