mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javierm@redhat.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	David Airlie <airlied@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Simona Vetter <simona@ffwll.ch>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/ssd130x: Set SPI .id_table to prevent an SPI core warning
Date: Tue, 31 Dec 2024 16:34:34 +0100	[thread overview]
Message-ID: <877c7fkgs5.fsf@minerva.mail-host-address-is-not-set> (raw)
In-Reply-To: <p2hzb3ysmthgfi4j6ehwulzk44zf4s5d6bm3nqs2rww47boshl@jr6aqmas4l5p>

Dmitry Baryshkov <dmitry.baryshkov@linaro.org> writes:

Hello Dmitry,

> On Tue, Dec 31, 2024 at 12:44:58PM +0100, Javier Martinez Canillas wrote:
>> The only reason for the ssd130x-spi driver to have an spi_device_id table
>> is that the SPI core always reports an "spi:" MODALIAS, even when the SPI
>> device has been registered via a Device Tree Blob.
>> 
>> Without spi_device_id table information in the module's metadata, module
>> autoloading would not work because there won't be an alias that matches
>> the MODALIAS reported by the SPI core.
>> 
>> This spi_device_id table is not needed for device matching though, since
>> the of_device_id table is always used in this case. For this reason, the
>> struct spi_driver .id_table field is currently not set in the SPI driver.
>> 
>> Because the spi_device_id table is always required for module autoloading,
>> the SPI core checks during driver registration that both an of_device_id
>> table and a spi_device_id table are present and that they contain the same
>> entries for all the SPI devices.
>> 
>> Not setting the .id_table field in the driver then confuses the core and
>> leads to the following warning when the ssd130x-spi driver is registered:
>> 
>>   [   41.091198] SPI driver ssd130x-spi has no spi_device_id for sinowealth,sh1106
>>   [   41.098614] SPI driver ssd130x-spi has no spi_device_id for solomon,ssd1305
>>   [   41.105862] SPI driver ssd130x-spi has no spi_device_id for solomon,ssd1306
>>   [   41.113062] SPI driver ssd130x-spi has no spi_device_id for solomon,ssd1307
>>   [   41.120247] SPI driver ssd130x-spi has no spi_device_id for solomon,ssd1309
>>   [   41.127449] SPI driver ssd130x-spi has no spi_device_id for solomon,ssd1322
>>   [   41.134627] SPI driver ssd130x-spi has no spi_device_id for solomon,ssd1325
>>   [   41.141784] SPI driver ssd130x-spi has no spi_device_id for solomon,ssd1327
>>   [   41.149021] SPI driver ssd130x-spi has no spi_device_id for solomon,ssd1331
>> 
>> To prevent the warning, set the .id_table even though it's not necessary.
>> 
>> Since the check is done even for built-in drivers, drop the condition to
>> only define the ID table when the driver is built as a module. Finally,
>> rename the variable to use the "_spi_id" convention used for ID tables.
>> 
>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
>
> Fixes: 74373977d2ca ("drm/solomon: Add SSD130x OLED displays SPI support")
>

I was on the fence about adding a Fixes: tag due a) the issue being there
from the beginning as you pointed out and b) the warning being harmless.

But I'll add it to v2 or just before pushing it to drm-misc-next.

> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>

Thanks for your review!

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


  reply	other threads:[~2024-12-31 15:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-31 11:44 Javier Martinez Canillas
2024-12-31 14:36 ` Dmitry Baryshkov
2024-12-31 15:34   ` Javier Martinez Canillas [this message]
2024-12-31 16:23     ` Dmitry Baryshkov
2024-12-31 17:03       ` Javier Martinez Canillas
2025-01-08 12:32         ` Javier Martinez Canillas

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=877c7fkgs5.fsf@minerva.mail-host-address-is-not-set \
    --to=javierm@redhat.com \
    --cc=airlied@gmail.com \
    --cc=broonie@kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®