mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Andrew F. Davis" <afd@ti.com>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: "Tomi Valkeinen" <tomi.valkeinen@ti.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"David Airlie" <airlied@linux.ie>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Benoît Cousson" <bcousson@baylibre.com>,
	"Tony Lindgren" <tony@atomide.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Bartlomiej Zolnierkiewicz" <b.zolnierkie@samsung.com>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Julia Lawall" <Julia.Lawall@lip6.fr>,
	"Sean Paul" <seanpaul@chromium.org>,
	dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-fbdev@vger.kernel.org, letux-kernel@openphoenux.org,
	kernel@pyra-handheld.com
Subject: Re: [PATCH v2 1/4] omapdrm: fix compatible string for td028ttec1
Date: Thu, 16 Nov 2017 12:32:33 -0600	[thread overview]
Message-ID: <2e67402b-4a32-9da9-3b06-e271c23d2422@ti.com> (raw)
In-Reply-To: <689D4636-A169-4C4A-89C2-7039C78E853F@goldelico.com>

On 11/16/2017 12:18 PM, H. Nikolaus Schaller wrote:
> 
>> Am 16.11.2017 um 18:08 schrieb Andrew F. Davis <afd@ti.com>:
>>
>> On 11/16/2017 10:10 AM, H. Nikolaus Schaller wrote:
>>> Hi Andrew,
>>>
>>>> Am 16.11.2017 um 16:53 schrieb Andrew F. Davis <afd@ti.com>:
>>>>
>>>> On 11/16/2017 07:43 AM, H. Nikolaus Schaller wrote:
>>>>>
>>>>>> Am 16.11.2017 um 13:32 schrieb Tomi Valkeinen <tomi.valkeinen@ti.com>:
>>>>>>
>>>>>> On 16/11/17 10:50, H. Nikolaus Schaller wrote:
>>>>>>> The vendor name was "toppoly" but other panels and the vendor list
>>>>>>> have defined it as "tpo". So let's fix it in driver and bindings.
>>>>>>>
>>>>>>> Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
>>>>>>> ---
>>>>>>
>>>>>>
>>>>>>> -MODULE_ALIAS("spi:toppoly,td028ttec1");
>>>>>>> +MODULE_ALIAS("spi:tpo,td028ttec1");
>>>>>>
>>>>>> Doesn't this mean that the module won't load if you have old bindings?
>>>>>
>>>>> Hm.
>>>>>
>>>>> Well, I think it can load but doesn't automatically from DT strings which might
>>>>> be unexpected.
>>>>>
>>>>>> Can't we have two module aliases?
>>>>>
>>>>> I think we can. Just a random example:
>>>>> https://elixir.free-electrons.com/linux/latest/source/drivers/w1/slaves/w1_therm.c#L754
>>>>>
>>>>> So we should keep both.
>>>>
>>>> Even better would be to drop both MODULE_ALIAS and let the
>>>> MODULE_DEVICE_TABLE macro define them for your from the SPI id table.
>>>
>>> Why would that be better?
>>>
>>
>> MODULE_ALIAS is ugly, you already have a table (usually) of device names
>> that are supported by the driver, the module aliases should be generated
>> from that table. This also keeps supported device list in one place.
>>
>>> As far as I see it will need more code and changes than adding one line of
>>> MODULE_ALIAS.
>>>
>>>> Although it doesn't look like this driver has an SPI id table, you
>>>> should probably add one, I be interested to see if this module is always
>>>> being matched through the "spi" or the "of" alias..
>>>
>>> Could you please propose how that code should look like, so that I can test?
>>>
>>
>> Sure,
>>
>> start with
>> $ udevadm monitor
>> and see what string the kernel is looking for when trying to find a
>> module for this device.
> 
> Well, the module is loaded automatically from DT at boot time well before
> I can start udevadm. So that is the most tricky part to setup the system
> to suppress this...
> 
>>
>> If it is only ever looking for "of:toppoly,td028ttec1", then you can
>> drop the MODULE_ALIAS and be done as it was never getting used anyway.
> 
> Since it is an SPI client, I am sure it looks for "spi:something.
> 
>>
>> What I expect though is "spi:toppoly,td028ttec1", in which case you
>> should add
>>
>> static const struct spi_device_id td028ttec1_ids[] = {
>> 	{ "toppoly,td028ttec1", 0 },
>> 	{ "tpo,td028ttec1", 0},
>> 	{ /* sentinel */ }
>> };
>> MODULE_DEVICE_TABLE(spi, td028ttec1_ids);
> 
> We already have a static const struct of_device_id td028ttec1_of_match[]
> table with the same information.
> 
> So we still have two places to keep in sync.
> 
> Or can we remove the td028ttec1_of_match[]? AFAIK not.
> 
>>
>> link to it in the td028ttec1_spi_driver struct:
>> .id_table = td028ttec1_ids,
>>
>> Then test again to see that the module still loads with the new and old
>> DT string.
> 
> In total I am not really convinced that adding 7 lines of code is better
> than one (the "tpo," alias) that is tested and works...
> 
> And it looks like a lot of unplanned code testing for me which takes more
> than 5 minutes :)
> 
> So I'd prefer to leave that exercise of fixing the MODULE_ALIAS/DEVICE_TABLE
> to someone else...
> 

That's fine, someday I'll probably get some script to do this for all
the drivers that still have MODULE_ALIAS and an existing table.

> BR and thanks,
> Nikolaus
> 
>>
>> Andrew
>>
>>> BR and thanks,
>>> Nikolaus Schaller
>>>
>>>>
>>>>>
>>>>> Should I submit a new version?
>>>>>
>>>>> BR,
>>>>> Nikolaus
>>>>>
>>>>> --
>>>>> To unsubscribe from this list: send the line "unsubscribe devicetree" in
>>>>> the body of a message to majordomo@vger.kernel.org
>>>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>>>
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe devicetree" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2017-11-16 18:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-16  8:50 [PATCH v2 0/4] Fixes for omapdrm on OpenPandora and GTA04 H. Nikolaus Schaller
2017-11-16  8:50 ` [PATCH v2 1/4] omapdrm: fix compatible string for td028ttec1 H. Nikolaus Schaller
2017-11-16 12:32   ` Tomi Valkeinen
2017-11-16 13:43     ` H. Nikolaus Schaller
2017-11-16 15:53       ` Andrew F. Davis
2017-11-16 16:10         ` H. Nikolaus Schaller
2017-11-16 17:08           ` Andrew F. Davis
2017-11-16 18:18             ` H. Nikolaus Schaller
2017-11-16 18:32               ` Andrew F. Davis [this message]
2017-11-16 18:56                 ` H. Nikolaus Schaller
2017-11-20  5:36                   ` H. Nikolaus Schaller
2017-11-16  8:50 ` [PATCH v2 2/4] DTS: GTA04: fix panel compatibility string H. Nikolaus Schaller
2017-11-28 14:57   ` Tony Lindgren
2017-11-28 15:01     ` H. Nikolaus Schaller
2017-11-28 15:10       ` Tony Lindgren
2017-11-28 15:48         ` H. Nikolaus Schaller
2017-11-28 16:00           ` Tony Lindgren
2017-11-28 16:04             ` H. Nikolaus Schaller
2017-11-16  8:50 ` [PATCH v2 3/4] DTS: Pandora: " H. Nikolaus Schaller
2017-11-16  8:50 ` [PATCH v2 4/4] drm: omapdrm: Fix DPI on platforms using the DSI VDDS H. Nikolaus Schaller
2017-11-21 10:25   ` Tomi Valkeinen
2017-11-21 10:38     ` H. Nikolaus Schaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2e67402b-4a32-9da9-3b06-e271c23d2422@ti.com \
    --to=afd@ti.com \
    --cc=Julia.Lawall@lip6.fr \
    --cc=airlied@linux.ie \
    --cc=b.zolnierkie@samsung.com \
    --cc=bcousson@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hns@goldelico.com \
    --cc=kernel@pyra-handheld.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=seanpaul@chromium.org \
    --cc=thierry.reding@gmail.com \
    --cc=tomi.valkeinen@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome