linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/st7735r: Fix module autoloading for Okaya RH128128T
@ 2022-05-20  9:16 Javier Martinez Canillas
  2022-05-20 12:02 ` Geert Uytterhoeven
  2022-05-20 15:33 ` David Lechner
  0 siblings, 2 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2022-05-20  9:16 UTC (permalink / raw)
  To: linux-kernel
  Cc: Geert Uytterhoeven, Javier Martinez Canillas, Daniel Vetter,
	David Airlie, David Lechner, Geert Uytterhoeven, Sam Ravnborg,
	dri-devel

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")
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---

 drivers/gpu/drm/tiny/st7735r.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/tiny/st7735r.c b/drivers/gpu/drm/tiny/st7735r.c
index 29d618093e94..e0f02d367d88 100644
--- a/drivers/gpu/drm/tiny/st7735r.c
+++ b/drivers/gpu/drm/tiny/st7735r.c
@@ -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);
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/st7735r: Fix module autoloading for Okaya RH128128T
  2022-05-20  9:16 [PATCH] drm/st7735r: Fix module autoloading for Okaya RH128128T Javier Martinez Canillas
@ 2022-05-20 12:02 ` Geert Uytterhoeven
  2022-05-23 14:11   ` Javier Martinez Canillas
  2022-05-20 15:33 ` David Lechner
  1 sibling, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2022-05-20 12:02 UTC (permalink / raw)
  To: Javier Martinez Canillas
  Cc: Linux Kernel Mailing List, Daniel Vetter, David Airlie,
	David Lechner, Sam Ravnborg, DRI Development, Mark Brown,
	linux-spi

Hi Javier,

CC spi

On Fri, May 20, 2022 at 11:16 AM Javier Martinez Canillas
<javierm@redhat.com> wrote:
> 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")
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>

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

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>


> --- a/drivers/gpu/drm/tiny/st7735r.c
> +++ b/drivers/gpu/drm/tiny/st7735r.c
> @@ -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 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/st7735r: Fix module autoloading for Okaya RH128128T
  2022-05-20  9:16 [PATCH] drm/st7735r: Fix module autoloading for Okaya RH128128T Javier Martinez Canillas
  2022-05-20 12:02 ` Geert Uytterhoeven
@ 2022-05-20 15:33 ` David Lechner
  1 sibling, 0 replies; 4+ messages in thread
From: David Lechner @ 2022-05-20 15:33 UTC (permalink / raw)
  To: Javier Martinez Canillas, linux-kernel
  Cc: Geert Uytterhoeven, Daniel Vetter, David Airlie,
	Geert Uytterhoeven, Sam Ravnborg, dri-devel

On 5/20/22 4:16 AM, Javier Martinez Canillas wrote:
> 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")
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> ---

Acked-by: David Lechner <david@lechnology.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/st7735r: Fix module autoloading for Okaya RH128128T
  2022-05-20 12:02 ` Geert Uytterhoeven
@ 2022-05-23 14:11   ` Javier Martinez Canillas
  0 siblings, 0 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2022-05-23 14:11 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linux Kernel Mailing List, Daniel Vetter, David Airlie,
	David Lechner, Sam Ravnborg, DRI Development, Mark Brown,
	linux-spi

Hello Geert,

On 5/20/22 14:02, Geert Uytterhoeven wrote:
> Hi Javier,
> 
> CC spi
> 
> On Fri, May 20, 2022 at 11:16 AM Javier Martinez Canillas
> <javierm@redhat.com> wrote:
>> 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")
>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> 
> Thanks for your patch!
> We really need to fix this at the subsystem level.
> 

Yes, agreed.

> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>

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

-- 
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-23 14:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-20  9:16 [PATCH] drm/st7735r: Fix module autoloading for Okaya RH128128T Javier Martinez Canillas
2022-05-20 12:02 ` Geert Uytterhoeven
2022-05-23 14:11   ` Javier Martinez Canillas
2022-05-20 15:33 ` David Lechner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).