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, 08 Nov 2023 17:13:13 +0100
From:   "Arnd Bergmann" <arnd@...db.de>
To:     Martin Tůma <tumic@...see.org>,
        "Arnd Bergmann" <arnd@...nel.org>,
        "Martin Tuma" <martin.tuma@...iteqautomotive.com>,
        "Mauro Carvalho Chehab" <mchehab@...nel.org>,
        "Hans Verkuil" <hverkuil-cisco@...all.nl>
Cc:     linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] media: pci: mgb4: remove bogus 'select' statements

On Fri, Oct 27, 2023, at 16:17, Martin Tůma wrote:
>
> On 23. 10. 23 18:05, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@...db.de>
>> 
>> As this is just a regular device driver, it has no business force-enabling
>> other drivers in the system, it should be entirely independent of the
>> implementation of the spi-nor layer or the specific DMA engine.
>> 
>
> The drivers are required for IP cores that are used on the card (in the 
> FPGA). Without I2C_XILINX and XILINX_XDMA the card won't work at all. 
> Without SPI_XILINX the access to the card's FLASH (used e.g. for FW 
> changes) won't be possible.
>
> A change to "depend" instead of "select" is thus possible if it makes 
> more sense to you, but removing it would make the module not compile or 
> not work at runtime (there is no symbol dependency to I2C_XILINX and 
> SPI_XILINX, but both need to be present and are loaded using 
> request_module() at runtime).

Sorry for the delay at getting back to you here.

I don't think there is a good answer here, though I normally
try to only list the minimal dependencies that are required
at build time. E.g. for on-chip devices we don't require the
use of a particular clock/irq/pin/gpio/... controller even if
we know exactly which of those are used on a given chip.

Since this is a PCI device, it's a bit different, so maybe
something like this would work to correctly document which
dependencies are required at build time vs run time:

--- a/drivers/media/pci/mgb4/Kconfig
+++ b/drivers/media/pci/mgb4/Kconfig
@@ -1,15 +1,13 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config VIDEO_MGB4
        tristate "Digiteq Automotive MGB4 support"
-       depends on VIDEO_DEV && PCI && I2C && DMADEVICES && SPI && MTD && IIO
+       depends on VIDEO_DEV && PCI && I2C && SPI && MTD && IIO
        depends on COMMON_CLK
+       depends on XILINX_XDMA
+       depends on (I2C_XILINX && SPI_XILINX) || COMPILE_TEST
        select VIDEOBUF2_DMA_SG
        select IIO_BUFFER
        select IIO_TRIGGERED_BUFFER
-       select I2C_XILINX
-       select SPI_XILINX
-       select MTD_SPI_NOR
-       select XILINX_XDMA
        help
          This is a video4linux driver for Digiteq Automotive MGB4 grabber
          cards.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ