linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI: video: Fix name collision with architecture's video.o
@ 2024-05-16 12:43 Thomas Zimmermann
  2024-05-16 13:04 ` Rafael J. Wysocki
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Zimmermann @ 2024-05-16 12:43 UTC (permalink / raw)
  To: rafael, lenb, arnd, chaitanya.kumar.borah, suresh.kumar.kurmi,
	jani.saarinen
  Cc: linux-acpi, linux-kernel, intel-gfx, linux-arch, linux-fbdev,
	dri-devel, Thomas Zimmermann

Commit 2fd001cd3600 ("arch: Rename fbdev header and source files")
renames the video source files under arch/ such that they does not
refer to fbdev any longer. The new files named video.o conflict with
ACPI's video.ko module. Modprobing the ACPI module can then fail with
warnings about missing symbols, as shown below.

  (i915_selftest:1107) igt_kmod-WARNING: i915: Unknown symbol acpi_video_unregister (err -2)
  (i915_selftest:1107) igt_kmod-WARNING: i915: Unknown symbol acpi_video_register_backlight (err -2)
  (i915_selftest:1107) igt_kmod-WARNING: i915: Unknown symbol __acpi_video_get_backlight_type (err -2)
  (i915_selftest:1107) igt_kmod-WARNING: i915: Unknown symbol acpi_video_register (err -2)

Fix this problem by renaming ACPI's video.ko to acpi_video.ko. Also
rename a related source file and clean up the Makefile.

Reported-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Closes: https://lore.kernel.org/intel-gfx/9dcac6e9-a3bf-4ace-bbdc-f697f767f9e0@suse.de/T/#t
Tested-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 2fd001cd3600 ("arch: Rename fbdev header and source files")
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-arch@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
---
 drivers/acpi/Makefile                            | 5 +++--
 drivers/acpi/{acpi_video.c => acpi_video_core.c} | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
 rename drivers/acpi/{acpi_video.c => acpi_video_core.c} (99%)

diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 8cc8c0d9c8732..fc9e11f7afbf7 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -84,7 +84,9 @@ obj-$(CONFIG_ACPI_FAN)		+= fan.o
 fan-objs			:= fan_core.o
 fan-objs			+= fan_attr.o
 
-obj-$(CONFIG_ACPI_VIDEO)	+= video.o
+obj-$(CONFIG_ACPI_VIDEO)	+= acpi_video.o
+acpi_video-objs			+= acpi_video_core.o video_detect.o
+
 obj-$(CONFIG_ACPI_TAD)		+= acpi_tad.o
 obj-$(CONFIG_ACPI_PCI_SLOT)	+= pci_slot.o
 obj-$(CONFIG_ACPI_PROCESSOR)	+= processor.o
@@ -124,7 +126,6 @@ obj-$(CONFIG_ACPI_CONFIGFS)	+= acpi_configfs.o
 
 obj-y				+= pmic/
 
-video-objs			+= acpi_video.o video_detect.o
 obj-y				+= dptf/
 
 obj-$(CONFIG_ARM64)		+= arm64/
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video_core.c
similarity index 99%
rename from drivers/acpi/acpi_video.c
rename to drivers/acpi/acpi_video_core.c
index 1fda303882973..32bf81c5773a4 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video_core.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
- *  video.c - ACPI Video Driver
+ *  acpi_video_core.c - ACPI Video Driver
  *
  *  Copyright (C) 2004 Luming Yu <luming.yu@intel.com>
  *  Copyright (C) 2004 Bruno Ducrot <ducrot@poupinou.org>
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ACPI: video: Fix name collision with architecture's video.o
  2024-05-16 12:43 [PATCH] ACPI: video: Fix name collision with architecture's video.o Thomas Zimmermann
@ 2024-05-16 13:04 ` Rafael J. Wysocki
  2024-05-16 15:03   ` Hans de Goede
  0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2024-05-16 13:04 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: rafael, lenb, arnd, chaitanya.kumar.borah, suresh.kumar.kurmi,
	jani.saarinen, linux-acpi, linux-kernel, intel-gfx, linux-arch,
	linux-fbdev, dri-devel, Hans de Goede

CC Hans who has been doing the majority of the ACPI video work.

On Thu, May 16, 2024 at 2:43 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>
> Commit 2fd001cd3600 ("arch: Rename fbdev header and source files")
> renames the video source files under arch/ such that they does not
> refer to fbdev any longer. The new files named video.o conflict with
> ACPI's video.ko module.

And surely nobody knew or was unable to check upfront that there was a
video.ko already in the kernel.

> Modprobing the ACPI module can then fail with warnings about missing symbols, as shown below.
>
>   (i915_selftest:1107) igt_kmod-WARNING: i915: Unknown symbol acpi_video_unregister (err -2)
>   (i915_selftest:1107) igt_kmod-WARNING: i915: Unknown symbol acpi_video_register_backlight (err -2)
>   (i915_selftest:1107) igt_kmod-WARNING: i915: Unknown symbol __acpi_video_get_backlight_type (err -2)
>   (i915_selftest:1107) igt_kmod-WARNING: i915: Unknown symbol acpi_video_register (err -2)
>
> Fix this problem by renaming ACPI's video.ko to acpi_video.ko. Also
> rename a related source file and clean up the Makefile.

If you insist on renaming, rename it to backlight.c (and
backlight_detect.c for consistency), because that's what it really is
about.

> Reported-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
> Closes: https://lore.kernel.org/intel-gfx/9dcac6e9-a3bf-4ace-bbdc-f697f767f9e0@suse.de/T/#t
> Tested-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Fixes: 2fd001cd3600 ("arch: Rename fbdev header and source files")
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: linux-arch@vger.kernel.org
> Cc: linux-fbdev@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org
> ---
>  drivers/acpi/Makefile                            | 5 +++--
>  drivers/acpi/{acpi_video.c => acpi_video_core.c} | 2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)
>  rename drivers/acpi/{acpi_video.c => acpi_video_core.c} (99%)
>
> diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
> index 8cc8c0d9c8732..fc9e11f7afbf7 100644
> --- a/drivers/acpi/Makefile
> +++ b/drivers/acpi/Makefile
> @@ -84,7 +84,9 @@ obj-$(CONFIG_ACPI_FAN)                += fan.o
>  fan-objs                       := fan_core.o
>  fan-objs                       += fan_attr.o
>
> -obj-$(CONFIG_ACPI_VIDEO)       += video.o
> +obj-$(CONFIG_ACPI_VIDEO)       += acpi_video.o
> +acpi_video-objs                        += acpi_video_core.o video_detect.o
> +
>  obj-$(CONFIG_ACPI_TAD)         += acpi_tad.o
>  obj-$(CONFIG_ACPI_PCI_SLOT)    += pci_slot.o
>  obj-$(CONFIG_ACPI_PROCESSOR)   += processor.o
> @@ -124,7 +126,6 @@ obj-$(CONFIG_ACPI_CONFIGFS) += acpi_configfs.o
>
>  obj-y                          += pmic/
>
> -video-objs                     += acpi_video.o video_detect.o
>  obj-y                          += dptf/
>
>  obj-$(CONFIG_ARM64)            += arm64/
> diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video_core.c
> similarity index 99%
> rename from drivers/acpi/acpi_video.c
> rename to drivers/acpi/acpi_video_core.c
> index 1fda303882973..32bf81c5773a4 100644
> --- a/drivers/acpi/acpi_video.c
> +++ b/drivers/acpi/acpi_video_core.c
> @@ -1,6 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0-or-later
>  /*
> - *  video.c - ACPI Video Driver
> + *  acpi_video_core.c - ACPI Video Driver
>   *
>   *  Copyright (C) 2004 Luming Yu <luming.yu@intel.com>
>   *  Copyright (C) 2004 Bruno Ducrot <ducrot@poupinou.org>
> --
> 2.45.0
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ACPI: video: Fix name collision with architecture's video.o
  2024-05-16 13:04 ` Rafael J. Wysocki
@ 2024-05-16 15:03   ` Hans de Goede
  2024-05-16 15:11     ` Thomas Zimmermann
  0 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2024-05-16 15:03 UTC (permalink / raw)
  To: Rafael J. Wysocki, Thomas Zimmermann
  Cc: lenb, arnd, chaitanya.kumar.borah, suresh.kumar.kurmi,
	jani.saarinen, linux-acpi, linux-kernel, intel-gfx, linux-arch,
	linux-fbdev, dri-devel

Hi,

On 5/16/24 3:04 PM, Rafael J. Wysocki wrote:
> CC Hans who has been doing the majority of the ACPI video work.
> 
> On Thu, May 16, 2024 at 2:43 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>>
>> Commit 2fd001cd3600 ("arch: Rename fbdev header and source files")
>> renames the video source files under arch/ such that they does not
>> refer to fbdev any longer. The new files named video.o conflict with
>> ACPI's video.ko module.
> 
> And surely nobody knew or was unable to check upfront that there was a
> video.ko already in the kernel.

Sorry, but nack for this change. I very deliberately kept the module-name
as video when renaming the actual .c file from video.c to acpi_video.c
because many people pass drivers/video/acpi_video.c module arguments
on the kernel commandline using video.param=val .

Try e.g. doing a duckduckgo search for 1 off:

"video.only_lcd"
"video.allow_duplicates"
"video.brightness_switch_enabled"

And you will find a lot of hits. The last one is even documented as
being "video.brightness_switch_enabled" in the main kernel-parameters.txt
as well as separately:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/kernel-parameters.txt#n39
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/kernel-parameters.txt#n7152
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/firmware-guide/acpi/video_extension.rst#n118

https://wiki.archlinux.org/title/Lenovo_ThinkPad_X1_Carbon#Brightness_control

If you rename this module then peoples config will break for
a whole lot of users.

So lets not do that and lets rename the new module which is causing
the conflict in the first place instead.

Regards,

Hans


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ACPI: video: Fix name collision with architecture's video.o
  2024-05-16 15:03   ` Hans de Goede
@ 2024-05-16 15:11     ` Thomas Zimmermann
  2024-05-16 15:16       ` Hans de Goede
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Zimmermann @ 2024-05-16 15:11 UTC (permalink / raw)
  To: Hans de Goede, Rafael J. Wysocki
  Cc: lenb, arnd, chaitanya.kumar.borah, suresh.kumar.kurmi,
	jani.saarinen, linux-acpi, linux-kernel, intel-gfx, linux-arch,
	linux-fbdev, dri-devel

Hi

Am 16.05.24 um 17:03 schrieb Hans de Goede:
> Hi,
>
> On 5/16/24 3:04 PM, Rafael J. Wysocki wrote:
>> CC Hans who has been doing the majority of the ACPI video work.
>>
>> On Thu, May 16, 2024 at 2:43 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>>> Commit 2fd001cd3600 ("arch: Rename fbdev header and source files")
>>> renames the video source files under arch/ such that they does not
>>> refer to fbdev any longer. The new files named video.o conflict with
>>> ACPI's video.ko module.
>> And surely nobody knew or was unable to check upfront that there was a
>> video.ko already in the kernel.
> Sorry, but nack for this change. I very deliberately kept the module-name
> as video when renaming the actual .c file from video.c to acpi_video.c
> because many people pass drivers/video/acpi_video.c module arguments
> on the kernel commandline using video.param=val .
>
> Try e.g. doing a duckduckgo search for 1 off:
>
> "video.only_lcd"
> "video.allow_duplicates"
> "video.brightness_switch_enabled"

Ok, that makes sense. I'll rename the other files.

Best regards
Thomas

>
> And you will find a lot of hits. The last one is even documented as
> being "video.brightness_switch_enabled" in the main kernel-parameters.txt
> as well as separately:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/kernel-parameters.txt#n39
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/kernel-parameters.txt#n7152
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/firmware-guide/acpi/video_extension.rst#n118
>
> https://wiki.archlinux.org/title/Lenovo_ThinkPad_X1_Carbon#Brightness_control
>
> If you rename this module then peoples config will break for
> a whole lot of users.
>
> So lets not do that and lets rename the new module which is causing
> the conflict in the first place instead.
>
> Regards,
>
> Hans
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ACPI: video: Fix name collision with architecture's video.o
  2024-05-16 15:11     ` Thomas Zimmermann
@ 2024-05-16 15:16       ` Hans de Goede
  0 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2024-05-16 15:16 UTC (permalink / raw)
  To: Thomas Zimmermann, Rafael J. Wysocki
  Cc: lenb, arnd, chaitanya.kumar.borah, suresh.kumar.kurmi,
	jani.saarinen, linux-acpi, linux-kernel, intel-gfx, linux-arch,
	linux-fbdev, dri-devel

Hi,

On 5/16/24 5:11 PM, Thomas Zimmermann wrote:
> Hi
> 
> Am 16.05.24 um 17:03 schrieb Hans de Goede:
>> Hi,
>>
>> On 5/16/24 3:04 PM, Rafael J. Wysocki wrote:
>>> CC Hans who has been doing the majority of the ACPI video work.
>>>
>>> On Thu, May 16, 2024 at 2:43 PM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>>>> Commit 2fd001cd3600 ("arch: Rename fbdev header and source files")
>>>> renames the video source files under arch/ such that they does not
>>>> refer to fbdev any longer. The new files named video.o conflict with
>>>> ACPI's video.ko module.
>>> And surely nobody knew or was unable to check upfront that there was a
>>> video.ko already in the kernel.
>> Sorry, but nack for this change. I very deliberately kept the module-name
>> as video when renaming the actual .c file from video.c to acpi_video.c
>> because many people pass drivers/video/acpi_video.c module arguments
>> on the kernel commandline using video.param=val .
>>
>> Try e.g. doing a duckduckgo search for 1 off:
>>
>> "video.only_lcd"
>> "video.allow_duplicates"
>> "video.brightness_switch_enabled"
> 
> Ok, that makes sense. I'll rename the other files.

Great, thank you.

Regards,

Hans



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-16 15:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-16 12:43 [PATCH] ACPI: video: Fix name collision with architecture's video.o Thomas Zimmermann
2024-05-16 13:04 ` Rafael J. Wysocki
2024-05-16 15:03   ` Hans de Goede
2024-05-16 15:11     ` Thomas Zimmermann
2024-05-16 15:16       ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).