lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 15 Dec 2021 09:50:34 +0100
From:   Javier Martinez Canillas <javierm@...hat.com>
To:     Thomas Zimmermann <tzimmermann@...e.de>,
        linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org
Cc:     Heiko Stübner <heiko@...ech.de>,
        "James (Qian) Wang" <james.qian.wang@....com>,
        Noralf Trønnes <noralf@...nnes.org>,
        Alexey Brodkin <abrodkin@...opsys.com>,
        Alison Wang <alison.wang@....com>,
        Anitha Chrisanthus <anitha.chrisanthus@...el.com>,
        Benjamin Gaignard <benjamin.gaignard@...aro.org>,
        Boris Brezillon <bbrezillon@...nel.org>,
        Brian Starkey <brian.starkey@....com>,
        Chen-Yu Tsai <wens@...e.org>,
        Chun-Kuang Hu <chunkuang.hu@...nel.org>,
        David Lechner <david@...hnology.com>,
        Deepak Rawat <drawat.floss@...il.com>,
        Edmund Dea <edmund.j.dea@...el.com>,
        Emma Anholt <emma@...olt.net>,
        Erico Nunes <nunes.erico@...il.com>,
        Hans de Goede <hdegoede@...hat.com>,
        Hyun Kwon <hyun.kwon@...inx.com>,
        Inki Dae <inki.dae@...sung.com>, Joel Stanley <joel@....id.au>,
        Joonyoung Shim <jy0922.shim@...sung.com>,
        Jyri Sarha <jyri.sarha@....fi>,
        Kamlesh Gurudasani <kamlesh.gurudasani@...il.com>,
        Kieran Bingham <kieran.bingham+renesas@...asonboard.com>,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Laurentiu Palcu <laurentiu.palcu@....nxp.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Liviu Dudau <liviu.dudau@....com>,
        Lucas Stach <l.stach@...gutronix.de>,
        Marek Vasut <marex@...x.de>,
        Maxime Ripard <mripard@...nel.org>,
        Neil Armstrong <narmstrong@...libre.com>,
        Oleksandr Andrushchenko <oleksandr_andrushchenko@...m.com>,
        Patrik Jakobsson <patrik.r.jakobsson@...il.com>,
        Paul Cercueil <paul@...pouillou.net>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Philippe Cornu <philippe.cornu@...s.st.com>,
        Qiang Yu <yuq825@...il.com>, Rob Clark <robdclark@...il.com>,
        Rob Herring <robh@...nel.org>,
        Russell King <linux+etnaviv@...linux.org.uk>,
        Russell King <linux@...linux.org.uk>,
        Sam Ravnborg <sam@...nborg.org>,
        Sandy Huang <hjc@...k-chips.com>, Sean Paul <sean@...rly.run>,
        Stefan Agner <stefan@...er.ch>,
        Thierry Reding <thierry.reding@...il.com>,
        Tian Tao <tiantao6@...ilicon.com>,
        Tomeu Vizoso <tomeu.vizoso@...labora.com>,
        Tomi Valkeinen <tomba@...nel.org>,
        Xinliang Liu <xinliang.liu@...aro.org>,
        Yannick Fertre <yannick.fertre@...s.st.com>
Subject: Re: [PATCH 00/60] drm: Make all drivers to honour the nomodeset
 parameter

Hello Thomas,

On 12/15/21 09:31, Thomas Zimmermann wrote:
> Hi Javier,
> 
> nothing wrong with your patches, but I'd like to propose slightly 
> differnt solution.
> 
> For many USB drivers, you put the drm_firmware_drivers_only() call into 
> the probe function. For registering, these drivers use 
> module_usb_driver(), which expands to generic device-register functions.
> 
> I'd like to propose a similar macro for DRM drivers that includes the 
> test for drm_firmware_drivers_only().
> 
> In drm_drv.h :
> 
>    #if defined(USB)
>    static int drm_usb_register(struct usb_driver *usb)
>    {
> 	if (drm_firmware_drivers_only())
> 		return -ENODEV;
> 	return usb_register_driver(usb);
>    }
>    #define drm_module_usb_driver(__usb)
> 	module_driver(drm_usb_register, usb_deregister)
>    #endif
> 
> In each of the USB-based DRM drivers, replace module_usb_driver with 
> drm_module_usb_driver.
> 
> And then there's PCI [3] and platform drivers, [4] which can be handled 
> similarly. Many PCI drivers open-code the module init and device 

Thanks for the suggestion. I actually thought about this approach as well,
since seems unnecessary to have all that duplicated logic in every driver.

But at the end decided to just do the less intrusive change, because can't
do any testing for most of the drivers.

> registering with the driver-specific enable parameter. Maybe adding a 
> driver-specific register function would make sense.
>

If I understood you correctly, suggested something similar in #dri-devel but
danvet's suggestion [0] was to keep it simple:

16:32 javierm: danvet: yes, I don't think we would be able to do it at this point. I'll add a function pointer
                       param to the check function so drivers can also define their own check besides nomodeset
16:33 danvet: javierm, uh that sounds a bit like overkill? just keep that part of the check in drivers?
16:33 javierm: danvet: Ok. Wanted to get rid of the duplicated code but I'm indeed over engineering this :)

[0]: https://people.freedesktop.org/~cbrill/dri-log/?channel=dri-devel&date=2021-11-02

> Best regards
> Thomas
> 
Best regards,
-- 
Javier Martinez Canillas
Linux Engineering
Red Hat

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ