media: Don't hide I²C or SPI drivers by default
Subsystems (2)
PATCH 1/1 media: Don't hide I²C or SPI drivers by default
MEDIA_HIDE_ANCILLARY_SUBDRV Kconfig option was intended for working with sub-device and other helper driver autoselection in cases where the required drivers are known, e.g. for PCI cards where all the related components are mounted. This option, however, applied to e.g. all camera sensor and lens VCM drivers that are generally present in systems without being mounted on such a card. This leads to easily omitting required drivers.
Drop the MEDIA_HIDE_ANCILLARY_SUBDRV for I²C and SPI devices.
--- drivers/media/i2c/Kconfig | 11 +---------- drivers/media/spi/Kconfig | 4 ---- 2 files changed, 1 insertion(+), 14 deletions(-)
drivers/media/i2c/Kconfig +1 -10
@@ -1010,14 +1010,12 @@ endmenu # V4L2 I2C drivers that aren't related with Camera support # -comment "audio, video and radio I2C drivers auto-selected by 'Autoselect ancillary drivers'" - depends on MEDIA_HIDE_ANCILLARY_SUBDRV +comment "audio, video and radio I2C drivers" # # Encoder / Decoder module configuration # menu "Audio decoders, processors and mixers" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_CS3308 tristate "Cirrus Logic CS3308 audio ADC"
@@ -1180,7 +1178,6 @@ config VIDEO_WM8775 endmenu menu "RDS decoders" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_SAA6588 tristate "SAA6588 Radio Chip RDS decoder support"
@@ -1197,7 +1194,6 @@ config VIDEO_SAA6588 endmenu menu "Video decoders" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_ADV7180 tristate "Analog Devices ADV7180 decoder"
@@ -1557,7 +1553,6 @@ source "drivers/media/i2c/cx25840/Kconfig" endmenu menu "Video encoders" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_ADV7170 tristate "Analog Devices ADV7170 video encoder"
@@ -1656,7 +1651,6 @@ config VIDEO_THS8200 endmenu menu "Video improvement chips" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_UPD64031A tristate "NEC Electronics uPD64031A Ghost Reduction"
@@ -1685,7 +1679,6 @@ config VIDEO_UPD64083 endmenu menu "Audio/Video compression chips" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_SAA6752HS tristate "Philips SAA6752HS MPEG-2 Audio/Video Encoder"
@@ -1701,7 +1694,6 @@ config VIDEO_SAA6752HS endmenu menu "SDR tuner chips" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config SDR_MAX2175 tristate "Maxim 2175 RF to Bits tuner"
@@ -1718,7 +1710,6 @@ config SDR_MAX2175 endmenu menu "Miscellaneous helper chips" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV source "drivers/media/i2c/cvs/Kconfig"
drivers/media/spi/Kconfig +0 -4
@@ -1,15 +1,11 @@ # SPDX-License-Identifier: GPL-2.0-only if VIDEO_DEV && SPI -comment "SPI I2C drivers auto-selected by 'Autoselect ancillary drivers'" - depends on MEDIA_HIDE_ANCILLARY_SUBDRV && SPI - menu "Media SPI Adapters" config CXD2880_SPI_DRV tristate "Sony CXD2880 SPI support" depends on DVB_CORE && SPI - default m if !MEDIA_SUBDRV_AUTOSELECT help Choose if you would like to have SPI interface support for Sony CXD2880.
base-commit: aedd77ea8168f00687c1248cdf115071e869cf93
Signature · 1 line
2.47.3
Quoted 11 lines · Sakari Ailus
MEDIA_HIDE_ANCILLARY_SUBDRVKconfigoption was intended for working with sub-device and other helper driver autoselection in cases where the required drivers are known, e.g. for PCI cards where all the related components are mounted. This option, however, applied to e.g. all camera sensor and lens VCM drivers that are generally present in systems without being mounted on such a card. This leads to easily omitting required drivers.Drop the
MEDIA_HIDE_ANCILLARY_SUBDRVfor I²C and SPI devices.Signed-off-by Sakari Ailus <[email protected]>
Regards,
Hans
Quoted 103 lines
--- drivers/media/i2c/Kconfig | 11 +---------- drivers/media/spi/Kconfig | 4 ---- 2 files changed, 1 insertion(+), 14 deletions(-)drivers/media/i2c/Kconfig +1
-10@@ -1010,14 +1010,12 @@ endmenu # V4L2 I2C drivers that aren't related with Camera support # -comment "audio, video and radio I2C drivers auto-selected by 'Autoselect ancillary drivers'" - depends on MEDIA_HIDE_ANCILLARY_SUBDRV +comment "audio, video and radio I2C drivers" # # Encoder / Decoder module configuration # menu "Audio decoders, processors and mixers" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_CS3308 tristate "Cirrus Logic CS3308 audio ADC"@@ -1180,7 +1178,6 @@ config VIDEO_WM8775 endmenu menu "RDS decoders" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_SAA6588 tristate "SAA6588 Radio Chip RDS decoder support"@@ -1197,7 +1194,6 @@ config VIDEO_SAA6588 endmenu menu "Video decoders" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_ADV7180 tristate "Analog Devices ADV7180 decoder"@@ -1557,7 +1553,6 @@ source "drivers/media/i2c/cx25840/Kconfig" endmenu menu "Video encoders" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_ADV7170 tristate "Analog Devices ADV7170 video encoder"@@ -1656,7 +1651,6 @@ config VIDEO_THS8200 endmenu menu "Video improvement chips" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_UPD64031A tristate "NEC Electronics uPD64031A Ghost Reduction"@@ -1685,7 +1679,6 @@ config VIDEO_UPD64083 endmenu menu "Audio/Video compression chips" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_SAA6752HS tristate "Philips SAA6752HS MPEG-2 Audio/Video Encoder"@@ -1701,7 +1694,6 @@ config VIDEO_SAA6752HS endmenu menu "SDR tuner chips" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config SDR_MAX2175 tristate "Maxim 2175 RF to Bits tuner"@@ -1718,7 +1710,6 @@ config SDR_MAX2175 endmenu menu "Miscellaneous helper chips" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV source "drivers/media/i2c/cvs/Kconfig"drivers/media/spi/Kconfig +0
-4@@ -1,15 +1,11 @@ # SPDX-License-Identifier: GPL-2.0-only if VIDEO_DEV && SPI -comment "SPI I2C drivers auto-selected by 'Autoselect ancillary drivers'" - depends on MEDIA_HIDE_ANCILLARY_SUBDRV && SPI - menu "Media SPI Adapters" config CXD2880_SPI_DRV tristate "Sony CXD2880 SPI support" depends on DVB_CORE && SPI - default m if !MEDIA_SUBDRV_AUTOSELECT help Choose if you would like to have SPI interface support for Sony CXD2880.base-commit:
aedd77ea8168f00687c1248cdf115071e869cf93
Quoted 9 lines · Sakari Ailus
MEDIA_HIDE_ANCILLARY_SUBDRVKconfigoption was intended for working with sub-device and other helper driver autoselection in cases where the required drivers are known, e.g. for PCI cards where all the related components are mounted. This option, however, applied to e.g. all camera sensor and lens VCM drivers that are generally present in systems without being mounted on such a card. This leads to easily omitting required drivers.Drop the
MEDIA_HIDE_ANCILLARY_SUBDRVfor I²C and SPI devices.
Hmmm, just wondering: Junjie's abandoned approach[1] had Fixes: and stable tags to ensure it was backported, which sounded wise, as people ran into problems that might or might not be considered regressions; shouldn't this one ideally have those, too?
[1]
https://lore.kernel.org/all/[email protected]/
Also wondering if the "olddefconfig" case on Arch was tested to ensure we prevent more people running into problems that Junjie's fix linked to (there was another one here:
https://bugzilla.kernel.org/show_bug.cgi?id=221983 ). But well, maybe those were corner cases not worth thinking about to much -- or should we?
Ciao, Thorsten
Quoted 104 lines
Signed-off-by Sakari Ailus <[email protected]>--- drivers/media/i2c/Kconfig | 11 +---------- drivers/media/spi/Kconfig | 4 ---- 2 files changed, 1 insertion(+), 14 deletions(-)drivers/media/i2c/Kconfig +1
-10@@ -1010,14 +1010,12 @@ endmenu # V4L2 I2C drivers that aren't related with Camera support # -comment "audio, video and radio I2C drivers auto-selected by 'Autoselect ancillary drivers'" - depends on MEDIA_HIDE_ANCILLARY_SUBDRV +comment "audio, video and radio I2C drivers" # # Encoder / Decoder module configuration # menu "Audio decoders, processors and mixers" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_CS3308 tristate "Cirrus Logic CS3308 audio ADC"@@ -1180,7 +1178,6 @@ config VIDEO_WM8775 endmenu menu "RDS decoders" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_SAA6588 tristate "SAA6588 Radio Chip RDS decoder support"@@ -1197,7 +1194,6 @@ config VIDEO_SAA6588 endmenu menu "Video decoders" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_ADV7180 tristate "Analog Devices ADV7180 decoder"@@ -1557,7 +1553,6 @@ source "drivers/media/i2c/cx25840/Kconfig" endmenu menu "Video encoders" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_ADV7170 tristate "Analog Devices ADV7170 video encoder"@@ -1656,7 +1651,6 @@ config VIDEO_THS8200 endmenu menu "Video improvement chips" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_UPD64031A tristate "NEC Electronics uPD64031A Ghost Reduction"@@ -1685,7 +1679,6 @@ config VIDEO_UPD64083 endmenu menu "Audio/Video compression chips" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config VIDEO_SAA6752HS tristate "Philips SAA6752HS MPEG-2 Audio/Video Encoder"@@ -1701,7 +1694,6 @@ config VIDEO_SAA6752HS endmenu menu "SDR tuner chips" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV config SDR_MAX2175 tristate "Maxim 2175 RF to Bits tuner"@@ -1718,7 +1710,6 @@ config SDR_MAX2175 endmenu menu "Miscellaneous helper chips" - visible if !MEDIA_HIDE_ANCILLARY_SUBDRV source "drivers/media/i2c/cvs/Kconfig"drivers/media/spi/Kconfig +0
-4@@ -1,15 +1,11 @@ # SPDX-License-Identifier: GPL-2.0-only if VIDEO_DEV && SPI -comment "SPI I2C drivers auto-selected by 'Autoselect ancillary drivers'" - depends on MEDIA_HIDE_ANCILLARY_SUBDRV && SPI - menu "Media SPI Adapters" config CXD2880_SPI_DRV tristate "Sony CXD2880 SPI support" depends on DVB_CORE && SPI - default m if !MEDIA_SUBDRV_AUTOSELECT help Choose if you would like to have SPI interface support for Sony CXD2880.base-commit:
aedd77ea8168f00687c1248cdf115071e869cf93
Quoted 2 lines · Thorsten Leemhuis
Also wondering if the "olddefconfig" case on Arch was tested to ensure we prevent more people running into problems that Junjie's fix linked to
Ran it: this patch on its base-commit, Arch's
config.x86_64 (7.2.4.arch1):
olddefconfig, before: no VIDEO_INTEL_CVS line olddefconfig, after: # CONFIG_VIDEO_INTEL_CVS is not set
The option has no default, so olddefconfig leaves it off. With the patch, oldconfig prompts for it as (NEW) and listnewconfig lists it.
Hi Junjie, Thorsten,
Quoted 7 lines · Junjie Cao
Quoted 2 lines · Thorsten Leemhuis
Also wondering if the "olddefconfig" case on Arch was tested to ensure we prevent more people running into problems that Junjie's fix linked to
Ran it: this patch on its base-commit, Arch's
config.x86_64 (7.2.4.arch1):
Quoted 6 lines
olddefconfig, before: no
VIDEO_INTEL_CVSline olddefconfig, after: #CONFIG_VIDEO_INTEL_CVSis not setThe option has no default, so olddefconfig leaves it off. With the patch, oldconfig prompts for it as (NEW) and listnewconfig lists it.
Generally drivers are unselected by default and cvs is no exception.
What I think we could possibly do is to add to cvs Kconfig:
default VIDEO_INTEL_IPU6
As the cvs driver is (at least right now) used with ipu6 driver only. That being said, there are probably dozens of configuration options you need to select to have a functional camera so doing this for cvs only won't make a lot of difference. I presume it was just a coincidence this happened on Arch.
This is still a configuration option that make oldconfig will ask about so it won't be silently ignored as when MEDIA_HIDE_ANCILLARY_SUBDRV was selected.
Signature · 3 lines
Kind regards, Sakari Ailus
Quoted 8 lines · Sakari Ailus
Quoted 7 lines · Junjie Cao
Quoted 2 lines · Thorsten Leemhuis
Also wondering if the "olddefconfig" case on Arch was tested to ensure we prevent more people running into problems that Junjie's fix linked to
Ran it: this patch on its base-commit, Arch's
config.x86_64 (7.2.4.arch1):
Quoted 8 lines
Quoted 6 lines
olddefconfig, before: no
VIDEO_INTEL_CVSline olddefconfig, after: #CONFIG_VIDEO_INTEL_CVSis not setThe option has no default, so olddefconfig leaves it off. With the patch, oldconfig prompts for it as (NEW) and listnewconfig lists it.
Generally drivers are unselected by default and cvs is no exception.
Yup, sure, but it seems we here due to some oddity (details don't matter much) ran into a situation that users perceive as regression (which matters a lot).
Quoted 5 lines
What I think we could possibly do is to add to cvs
Kconfig:default
VIDEO_INTEL_IPU6As the cvs driver is (at least right now) used with ipu6 driver only.
Due to what I wrote above I'd say: this sounds like a good solution that has no significant downsides -- and avoids a problem for everyone that manually configures their kernel in the future, which is a good thing, too. And we can easily drop the default later if there is a strong need (and then likely should add a hint to the help text which other symbols are needed in case it doesn't have one already; didn't check)
Ciao, Thorsten
Hi Thorsten,
Quoted 16 lines · Thorsten Leemhuis
Quoted 15 lines · Sakari Ailus
Quoted 13 lines · Junjie Cao
Quoted 2 lines · Thorsten Leemhuis
Also wondering if the "olddefconfig" case on Arch was tested to ensure we prevent more people running into problems that Junjie's fix linked to
Ran it: this patch on its base-commit, Arch's
config.x86_64 (7.2.4.arch1):olddefconfig, before: no
VIDEO_INTEL_CVSline olddefconfig, after: #CONFIG_VIDEO_INTEL_CVSis not setThe option has no default, so olddefconfig leaves it off. With the patch, oldconfig prompts for it as (NEW) and listnewconfig lists it.
Quoted 5 lines
Quoted 1 line
Generally drivers are unselected by default and cvs is no exception.
Yup, sure, but it seems we here due to some oddity (details don't matter much) ran into a situation that users perceive as regression (which matters a lot).
It was really about this option being hidden by default so you couldn't even select it. (It's no wonder: I had enabled EXPERT in my own .config, quite possibly more than 10 years ago, to select things without much thinking about it!)
Quoted 4 lines
Quoted 4 lines
What I think we could possibly do is to add to cvs
Kconfig:default
VIDEO_INTEL_IPU6
Quoted 8 lines
Quoted 1 line
As the cvs driver is (at least right now) used with ipu6 driver only.
Due to what I wrote above I'd say: this sounds like a good solution that has no significant downsides -- and avoids a problem for everyone that manually configures their kernel in the future, which is a good thing, too. And we can easily drop the default later if there is a strong need (and then likely should add a hint to the help text which other symbols are needed in case it doesn't have one already; didn't check)
I can post a patch. I think what also made a difference was that the CVS chip was in a different menu because it's an I²C device.
Signature · 3 lines
Regards, Sakari Ailus