linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* modinfo crc32 broken after fd44a98ae2eb
@ 2016-01-27 19:32 Samson Yeung
  2016-01-28 19:21 ` Lucas De Marchi
  0 siblings, 1 reply; 9+ messages in thread
From: Samson Yeung @ 2016-01-27 19:32 UTC (permalink / raw)
  To: linux-modules

Hi all,

Please reply directly as I am not on this list.

Commit "fd44a98ae2eb Fix race while loading modules" also broke 'modinfo 
crc32', specifically, for me.

Is this a bug, is it something strange going on with crc32, or is it 
intended behavior?

This happens on the official RedHat EL7 kernels, and also Ubuntu Wily's 
kernel.


Regards,
-Samson


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

* Re: modinfo crc32 broken after fd44a98ae2eb
  2016-01-27 19:32 modinfo crc32 broken after fd44a98ae2eb Samson Yeung
@ 2016-01-28 19:21 ` Lucas De Marchi
  2016-01-28 22:40   ` Samson Yeung
  0 siblings, 1 reply; 9+ messages in thread
From: Lucas De Marchi @ 2016-01-28 19:21 UTC (permalink / raw)
  To: Samson Yeung; +Cc: linux-modules

Hi Samson,

On Wed, Jan 27, 2016 at 5:32 PM, Samson Yeung <samson.yeung@oracle.com> wrote:
> Hi all,
>
> Please reply directly as I am not on this list.
>
> Commit "fd44a98ae2eb Fix race while loading modules" also broke 'modinfo
> crc32', specifically, for me.
>
> Is this a bug, is it something strange going on with crc32, or is it
> intended behavior?

breaking is never intended ;-). What do you mean by "break"? Does it crash?

I can't see how this commit is related to modinfo. You will need to
give more details. Check if you can get the output by passing the
complete path to the module and make sure it's actually a module (and
not builtin) in your kernel configuration

Lucas De Marchi

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

* Re: modinfo crc32 broken after fd44a98ae2eb
  2016-01-28 19:21 ` Lucas De Marchi
@ 2016-01-28 22:40   ` Samson Yeung
  2016-01-29  1:35     ` Lucas De Marchi
  0 siblings, 1 reply; 9+ messages in thread
From: Samson Yeung @ 2016-01-28 22:40 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-modules

[-- Attachment #1: Type: text/plain, Size: 2227 bytes --]


On 01/28/2016 11:21 AM, Lucas De Marchi wrote:
> Hi Samson,
>
> On Wed, Jan 27, 2016 at 5:32 PM, Samson Yeung <samson.yeung@oracle.com> wrote:
>> Hi all,
>>
>> Please reply directly as I am not on this list.
>>
>> Commit "fd44a98ae2eb Fix race while loading modules" also broke 'modinfo
>> crc32', specifically, for me.
>>
>> Is this a bug, is it something strange going on with crc32, or is it
>> intended behavior?
>
> breaking is never intended ;-). What do you mean by "break"? Does it crash?

'modinfo crc32' prints

modinfo: ERROR: Module crc32 not found.

and a return value of 1 using fd44a98ae2eb.

Without changing the contents of /lib/modules/`uname -r`/modules.* 
files, using fd44a98ae2eb^, 'modinfo crc32' gives me the expected info 
about crc32 instead:

filename:       /lib/modules/4.2.0-25-generic/kernel/crypto/crc32.ko
alias:          crypto-crc32
alias:          crc32
license:        GPL
description:    CRC32 calculations wrapper for lib/crc32
author:         Alexander Boyko <alexander_boyko@xyratex.com>
srcversion:     B0DE005719AC9ED9A3EEAD7
depends:
intree:         Y
vermagic:       4.2.0-25-generic SMP mod_unload modversions
signer:         Build time autogenerated kernel key
sig_key:        A4:10:30:FB:DF:1D:C9:62:B4:BB:7D:16:44:C3:33:7E:C4:16:DB:86
sig_hashalgo:   sha512

> I can't see how this commit is related to modinfo. You will need to
> give more details. Check if you can get the output by passing the
> complete path to the module and make sure it's actually a module (and

Giving the full path to the module still works as expected, so
'modinfo /lib/modules/4.2.0-25-generic/kernel/crypto/crc32.ko' displays 
module information and returns 0, using both fd44a98ae2eb^ and fd44a98ae2eb.

> not builtin) in your kernel configuration

I must admit that I'm slightly confused wrt crc32, since there is 
kernel/arch/x86/crypto/crc32-pclmul.ko as well as 
kernel/crypto/crc32.ko, and 'modinfo crc32-pclmul' claims that crc32 is 
an alias.

I This happens with a stock Ubuntu kernel (4.2.0-25-generic for Wily), 
however I first observed this behavior on Redhat/Oracle Linux 7.

> Lucas De Marchi

I have attached a slightly more complete log demonstrating the issue.


Regards,
-Samson

[-- Attachment #2: kmod-crc32.log --]
[-- Type: text/x-log, Size: 1442 bytes --]

fragmede@biem:((tags/v20~8))~/tmp/kmod/git/kernel.org/kmod.git$ git checkout fd44a98ae2eb^ && ./autogen.sh >/dev/null && ./configure >/dev/null && make -j `nproc` >/dev/null && ./tools/modinfo crc32
Previous HEAD position was fd44a98ae2eb... Fix race while loading modules
HEAD is now at fae77516b405... build: we are kmod, not systemd
ar: `u' modifier ignored since `D' is the default (see `U')
filename:       /lib/modules/4.2.0-25-generic/kernel/crypto/crc32.ko
alias:          crypto-crc32
alias:          crc32
license:        GPL
description:    CRC32 calculations wrapper for lib/crc32
author:         Alexander Boyko <alexander_boyko@xyratex.com>
srcversion:     B0DE005719AC9ED9A3EEAD7
depends:        
intree:         Y
vermagic:       4.2.0-25-generic SMP mod_unload modversions 
signer:         Build time autogenerated kernel key
sig_key:        A4:10:30:FB:DF:1D:C9:62:B4:BB:7D:16:44:C3:33:7E:C4:16:DB:86
sig_hashalgo:   sha512
fragmede@biem:((tags/v20~9))~/tmp/kmod/git/kernel.org/kmod.git$ git checkout fd44a98ae2eb && ./autogen.sh >/dev/null && ./configure >/dev/null && make -j `nproc` >/dev/null && ./tools/modinfo crc32
Previous HEAD position was fae77516b405... build: we are kmod, not systemd
HEAD is now at fd44a98ae2eb... Fix race while loading modules
ar: `u' modifier ignored since `D' is the default (see `U')
modinfo: ERROR: Module crc32 not found.
fragmede@biem:((tags/v20~8))~/tmp/kmod/git/kernel.org/kmod.git$ 

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

* Re: modinfo crc32 broken after fd44a98ae2eb
  2016-01-28 22:40   ` Samson Yeung
@ 2016-01-29  1:35     ` Lucas De Marchi
  2016-01-29  5:54       ` Duplicated module names Rusty Russell
  0 siblings, 1 reply; 9+ messages in thread
From: Lucas De Marchi @ 2016-01-29  1:35 UTC (permalink / raw)
  To: Samson Yeung; +Cc: linux-modules, Rusty Russell, lkml, linux-crypto

Hi!

CC'ing Rusty and mailing lists

On Thu, Jan 28, 2016 at 8:40 PM, Samson Yeung <samson.yeung@oracle.com> wrote:
>
> On 01/28/2016 11:21 AM, Lucas De Marchi wrote:
>>
>> Hi Samson,
>>
>> On Wed, Jan 27, 2016 at 5:32 PM, Samson Yeung <samson.yeung@oracle.com>
>> wrote:
>>>
>>> Hi all,
>>>
>>> Please reply directly as I am not on this list.
>>>
>>> Commit "fd44a98ae2eb Fix race while loading modules" also broke 'modinfo
>>> crc32', specifically, for me.
>>>
>>> Is this a bug, is it something strange going on with crc32, or is it
>>> intended behavior?
>>
>>
>> breaking is never intended ;-). What do you mean by "break"? Does it
>> crash?
>
>
> 'modinfo crc32' prints
>
> modinfo: ERROR: Module crc32 not found.
>
> and a return value of 1 using fd44a98ae2eb.
>
> Without changing the contents of /lib/modules/`uname -r`/modules.* files,
> using fd44a98ae2eb^, 'modinfo crc32' gives me the expected info about crc32
> instead:
>
> filename:       /lib/modules/4.2.0-25-generic/kernel/crypto/crc32.ko
> alias:          crypto-crc32
> alias:          crc32
> license:        GPL
> description:    CRC32 calculations wrapper for lib/crc32
> author:         Alexander Boyko <alexander_boyko@xyratex.com>
> srcversion:     B0DE005719AC9ED9A3EEAD7
> depends:
> intree:         Y
> vermagic:       4.2.0-25-generic SMP mod_unload modversions
> signer:         Build time autogenerated kernel key
> sig_key:        A4:10:30:FB:DF:1D:C9:62:B4:BB:7D:16:44:C3:33:7E:C4:16:DB:86
> sig_hashalgo:   sha512
>
>> I can't see how this commit is related to modinfo. You will need to
>> give more details. Check if you can get the output by passing the
>> complete path to the module and make sure it's actually a module (and
>
>
> Giving the full path to the module still works as expected, so
> 'modinfo /lib/modules/4.2.0-25-generic/kernel/crypto/crc32.ko' displays
> module information and returns 0, using both fd44a98ae2eb^ and fd44a98ae2eb.
>
>> not builtin) in your kernel configuration
>
>
> I must admit that I'm slightly confused wrt crc32, since there is
> kernel/arch/x86/crypto/crc32-pclmul.ko as well as kernel/crypto/crc32.ko,
> and 'modinfo crc32-pclmul' claims that crc32 is an alias.
>
> I This happens with a stock Ubuntu kernel (4.2.0-25-generic for Wily),
> however I first observed this behavior on Redhat/Oracle Linux 7.


So... it looks like we have both kernel/lib/crc32.ko and
kernel/crypto/crc32.ko - module names should be global. It doesn't clash in
the kernel build because kernel/lib/crc32 is builtin most of the time.

With that commit in kmod there was a change on the builtin detection to fix
the race. I'll take a look to fix this, but it should probably be
fixed in the kernel
 as well.

Rusty and ohers: it looks like both CONFIG_CRC32 and
CONFIG_CRYPTO_CRC32 can be compiled as module, and they generate
modules with the same name, crc32.  Could that be fixed?


Lucas De Marchi

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

* Duplicated module names
  2016-01-29  1:35     ` Lucas De Marchi
@ 2016-01-29  5:54       ` Rusty Russell
  2016-01-29  7:04         ` Tomi Valkeinen
                           ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Rusty Russell @ 2016-01-29  5:54 UTC (permalink / raw)
  To: Lucas De Marchi, Samson Yeung
  Cc: linux-modules, lkml, linux-crypto, David Airlie, Tomi Valkeinen,
	Kyungmin Park, Greg Kroah-Hartman, Liam Girdwood, Mark Brown

Lucas De Marchi <lucas.de.marchi@gmail.com> writes:
> Hi!
>
> CC'ing Rusty and mailing lists

Thanks.

> Rusty and ohers: it looks like both CONFIG_CRC32 and
> CONFIG_CRYPTO_CRC32 can be compiled as module, and they generate
> modules with the same name, crc32.  Could that be fixed?

Gah.  Looks like it's been that way since at least 2014, too.

I think we could rename it to crypto_crc32, but I don't think it's the
only one.  Marco, I think depmod should probably FAIL if two modules
have the same name, which would at least find such problems.

(BTW is there a nice way to figure out if a config var is a tristate?  These
are only problematic if both CONFIG_ are tristate.)

Here's a hacky attempt to look for problems:

rusty@rusty-Lemur:~/devel/kernel/linux (master)$ KCONFIGS=`find * -name 'Kconfig*'`; for m in `find [b-z]* -name 'Makefile*'`; do sed -n 's,obj-\$(CONFIG.*+= \([a-z0-9_-]\+\.o\)$,'$m' \1,p' <$m | sort -u; done | sort -k 2 | uniq -D -f 1 | while read m obj; do fgrep -w $obj $m /dev/null; done | while read LINE; do conf=`echo $LINE | sed 's/.*\$(CONFIG_\([A-Z0-9_]*\).*/\1/'`; if grep -C2 "^config $conf\$" $KCONFIGS | fgrep -q tristate; then echo $LINE; fi; done

Here are the results (mildly filtered by me):

drivers/gpu/drm/i2c/Makefile:obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511.o
drivers/media/i2c/Makefile:obj-$(CONFIG_VIDEO_ADV7511) += adv7511.o

drivers/media/platform/coda/Makefile:obj-$(CONFIG_VIDEO_CODA) += coda.o
fs/coda/Makefile:obj-$(CONFIG_CODA_FS) += coda.o

drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_CONNECTOR_ANALOG_TV) += connector-analog-tv.o
drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_CONNECTOR_ANALOG_TV) += connector-analog-tv.o

drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_CONNECTOR_DVI) += connector-dvi.o
drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_CONNECTOR_DVI) += connector-dvi.o

drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_CONNECTOR_HDMI) += connector-hdmi.o
drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_CONNECTOR_HDMI) += connector-hdmi.o

crypto/Makefile:obj-$(CONFIG_CRYPTO_CRC32) += crc32.o
lib/Makefile:obj-$(CONFIG_CRC32) += crc32.o

drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_ENCODER_OPA362) += encoder-opa362.o
drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_ENCODER_OPA362) += encoder-opa362.o

drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_ENCODER_TFP410) += encoder-tfp410.o
drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_ENCODER_TFP410) += encoder-tfp410.o

drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_ENCODER_TPD12S015) += encoder-tpd12s015.o
drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_ENCODER_TPD12S015) += encoder-tpd12s015.o

drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_DPI) += panel-dpi.o
drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_DPI) += panel-dpi.o

drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_DSI_CM) += panel-dsi-cm.o
drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_DSI_CM) += panel-dsi-cm.o

drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.o
drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.o

drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o
drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o

drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o

drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o
drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o

drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o
drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o

drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o

drivers/mtd/onenand/Makefile:obj-$(CONFIG_MTD_ONENAND_SAMSUNG) += samsung.o
drivers/tty/serial/Makefile:obj-$(CONFIG_SERIAL_SAMSUNG) += samsung.o

sound/soc/codecs/Makefile:obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o
sound/soc/samsung/Makefile:obj-$(CONFIG_SND_SAMSUNG_AC97) += snd-soc-ac97.o

drivers/hwmon/Makefile:obj-$(CONFIG_SENSORS_VEXPRESS) += vexpress.o
drivers/regulator/Makefile:obj-$(CONFIG_REGULATOR_VEXPRESS) += vexpress.o

Can maintainers please tell me which of these are harmless?

Thanks!
Rusty.

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

* Re: Duplicated module names
  2016-01-29  5:54       ` Duplicated module names Rusty Russell
@ 2016-01-29  7:04         ` Tomi Valkeinen
  2016-01-29 10:20         ` Herbert Xu
                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Tomi Valkeinen @ 2016-01-29  7:04 UTC (permalink / raw)
  To: Rusty Russell, Lucas De Marchi, Samson Yeung
  Cc: linux-modules, lkml, linux-crypto, David Airlie, Kyungmin Park,
	Greg Kroah-Hartman, Liam Girdwood, Mark Brown

[-- Attachment #1: Type: text/plain, Size: 5682 bytes --]


On 29/01/16 07:54, Rusty Russell wrote:
> Lucas De Marchi <lucas.de.marchi@gmail.com> writes:
>> Hi!
>>
>> CC'ing Rusty and mailing lists
> 
> Thanks.
> 
>> Rusty and ohers: it looks like both CONFIG_CRC32 and
>> CONFIG_CRYPTO_CRC32 can be compiled as module, and they generate
>> modules with the same name, crc32.  Could that be fixed?
> 
> Gah.  Looks like it's been that way since at least 2014, too.
> 
> I think we could rename it to crypto_crc32, but I don't think it's the
> only one.  Marco, I think depmod should probably FAIL if two modules
> have the same name, which would at least find such problems.
> 
> (BTW is there a nice way to figure out if a config var is a tristate?  These
> are only problematic if both CONFIG_ are tristate.)
> 
> Here's a hacky attempt to look for problems:
> 
> rusty@rusty-Lemur:~/devel/kernel/linux (master)$ KCONFIGS=`find * -name 'Kconfig*'`; for m in `find [b-z]* -name 'Makefile*'`; do sed -n 's,obj-\$(CONFIG.*+= \([a-z0-9_-]\+\.o\)$,'$m' \1,p' <$m | sort -u; done | sort -k 2 | uniq -D -f 1 | while read m obj; do fgrep -w $obj $m /dev/null; done | while read LINE; do conf=`echo $LINE | sed 's/.*\$(CONFIG_\([A-Z0-9_]*\).*/\1/'`; if grep -C2 "^config $conf\$" $KCONFIGS | fgrep -q tristate; then echo $LINE; fi; done
> 
> Here are the results (mildly filtered by me):
> 
> drivers/gpu/drm/i2c/Makefile:obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511.o
> drivers/media/i2c/Makefile:obj-$(CONFIG_VIDEO_ADV7511) += adv7511.o
> 
> drivers/media/platform/coda/Makefile:obj-$(CONFIG_VIDEO_CODA) += coda.o
> fs/coda/Makefile:obj-$(CONFIG_CODA_FS) += coda.o
> 
> drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_CONNECTOR_ANALOG_TV) += connector-analog-tv.o
> drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_CONNECTOR_ANALOG_TV) += connector-analog-tv.o
> 
> drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_CONNECTOR_DVI) += connector-dvi.o
> drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_CONNECTOR_DVI) += connector-dvi.o
> 
> drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_CONNECTOR_HDMI) += connector-hdmi.o
> drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_CONNECTOR_HDMI) += connector-hdmi.o
> 
> crypto/Makefile:obj-$(CONFIG_CRYPTO_CRC32) += crc32.o
> lib/Makefile:obj-$(CONFIG_CRC32) += crc32.o
> 
> drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_ENCODER_OPA362) += encoder-opa362.o
> drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_ENCODER_OPA362) += encoder-opa362.o
> 
> drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_ENCODER_TFP410) += encoder-tfp410.o
> drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_ENCODER_TFP410) += encoder-tfp410.o
> 
> drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_ENCODER_TPD12S015) += encoder-tpd12s015.o
> drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_ENCODER_TPD12S015) += encoder-tpd12s015.o
> 
> drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_DPI) += panel-dpi.o
> drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_DPI) += panel-dpi.o
> 
> drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_DSI_CM) += panel-dsi-cm.o
> drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_DSI_CM) += panel-dsi-cm.o
> 
> drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.o
> drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.o
> 
> drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o
> drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o
> 
> drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
> drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
> 
> drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o
> drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o
> 
> drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o
> drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o
> 
> drivers/gpu/drm/omapdrm/displays/Makefile:obj-$(CONFIG_DISPLAY_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
> drivers/video/fbdev/omap2/omapfb/displays/Makefile:obj-$(CONFIG_FB_OMAP2_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o
> 
> drivers/mtd/onenand/Makefile:obj-$(CONFIG_MTD_ONENAND_SAMSUNG) += samsung.o
> drivers/tty/serial/Makefile:obj-$(CONFIG_SERIAL_SAMSUNG) += samsung.o
> 
> sound/soc/codecs/Makefile:obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o
> sound/soc/samsung/Makefile:obj-$(CONFIG_SND_SAMSUNG_AC97) += snd-soc-ac97.o
> 
> drivers/hwmon/Makefile:obj-$(CONFIG_SENSORS_VEXPRESS) += vexpress.o
> drivers/regulator/Makefile:obj-$(CONFIG_REGULATOR_VEXPRESS) += vexpress.o
> 
> Can maintainers please tell me which of these are harmless?

The duplicates under drivers/gpu/drm/omapdrm/ and
drivers/video/fbdev/omap2/ are (hopefully) harmless, as the DRM driver
and the fbdev driver are mutually exclusive.

 Tomi


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: Duplicated module names
  2016-01-29  5:54       ` Duplicated module names Rusty Russell
  2016-01-29  7:04         ` Tomi Valkeinen
@ 2016-01-29 10:20         ` Herbert Xu
  2016-01-29 15:58         ` Sudeep Holla
  2016-01-29 19:08         ` Lucas De Marchi
  3 siblings, 0 replies; 9+ messages in thread
From: Herbert Xu @ 2016-01-29 10:20 UTC (permalink / raw)
  To: Rusty Russell
  Cc: lucas.de.marchi, samson.yeung, linux-modules, linux-kernel,
	linux-crypto, airlied, tomi.valkeinen, kyungmin.park, gregkh,
	lgirdwood, broonie

Rusty Russell <rusty@rustcorp.com.au> wrote:
> 
> I think we could rename it to crypto_crc32, but I don't think it's the
> only one.  Marco, I think depmod should probably FAIL if two modules
> have the same name, which would at least find such problems.

This patch renames it to crc32_generic.

---8<---
Subject: crypto: crc32 - Rename generic implementation

The generic crc32 implementation is currently called crc32.  This
is a problem because it clashes with the lib implementation of crc32.

This patch renames the crypto crc32 to crc32_generic so that it is
consistent with crc32c.  An alias for the driver is also added.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/crypto/Makefile b/crypto/Makefile
index ffe18c9..059de1b 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -100,7 +100,7 @@ obj-$(CONFIG_CRYPTO_POLY1305) += poly1305_generic.o
 obj-$(CONFIG_CRYPTO_DEFLATE) += deflate.o
 obj-$(CONFIG_CRYPTO_MICHAEL_MIC) += michael_mic.o
 obj-$(CONFIG_CRYPTO_CRC32C) += crc32c_generic.o
-obj-$(CONFIG_CRYPTO_CRC32) += crc32.o
+obj-$(CONFIG_CRYPTO_CRC32) += crc32_generic.o
 obj-$(CONFIG_CRYPTO_CRCT10DIF) += crct10dif_common.o crct10dif_generic.o
 obj-$(CONFIG_CRYPTO_AUTHENC) += authenc.o authencesn.o
 obj-$(CONFIG_CRYPTO_LZO) += lzo.o
diff --git a/crypto/crc32.c b/crypto/crc32_generic.c
similarity index 98%
rename from crypto/crc32.c
rename to crypto/crc32_generic.c
index 187ded2..aa2a25f 100644
--- a/crypto/crc32.c
+++ b/crypto/crc32_generic.c
@@ -131,7 +131,7 @@ static struct shash_alg alg = {
 	.digestsize	= CHKSUM_DIGEST_SIZE,
 	.base		= {
 		.cra_name		= "crc32",
-		.cra_driver_name	= "crc32-table",
+		.cra_driver_name	= "crc32-generic",
 		.cra_priority		= 100,
 		.cra_blocksize		= CHKSUM_BLOCK_SIZE,
 		.cra_ctxsize		= sizeof(u32),
@@ -157,3 +157,4 @@ MODULE_AUTHOR("Alexander Boyko <alexander_boyko@xyratex.com>");
 MODULE_DESCRIPTION("CRC32 calculations wrapper for lib/crc32");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_CRYPTO("crc32");
+MODULE_ALIAS_CRYPTO("crc32-generic");
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: Duplicated module names
  2016-01-29  5:54       ` Duplicated module names Rusty Russell
  2016-01-29  7:04         ` Tomi Valkeinen
  2016-01-29 10:20         ` Herbert Xu
@ 2016-01-29 15:58         ` Sudeep Holla
  2016-01-29 19:08         ` Lucas De Marchi
  3 siblings, 0 replies; 9+ messages in thread
From: Sudeep Holla @ 2016-01-29 15:58 UTC (permalink / raw)
  To: Rusty Russell
  Cc: Lucas De Marchi, Samson Yeung, linux-modules, lkml, linux-crypto,
	David Airlie, Tomi Valkeinen, Kyungmin Park, Greg Kroah-Hartman,
	Liam Girdwood, Mark Brown, Sudeep Holla

On Fri, Jan 29, 2016 at 5:54 AM, Rusty Russell <rusty@rustcorp.com.au> wrot=
e:
> Lucas De Marchi <lucas.de.marchi@gmail.com> writes:
>> Hi!
>>
>> CC'ing Rusty and mailing lists
>
> Thanks.
>
>> Rusty and ohers: it looks like both CONFIG_CRC32 and
>> CONFIG_CRYPTO_CRC32 can be compiled as module, and they generate
>> modules with the same name, crc32.  Could that be fixed?
>
> Gah.  Looks like it's been that way since at least 2014, too.
>
> I think we could rename it to crypto_crc32, but I don't think it's the
> only one.  Marco, I think depmod should probably FAIL if two modules
> have the same name, which would at least find such problems.
>
> (BTW is there a nice way to figure out if a config var is a tristate?  Th=
ese
> are only problematic if both CONFIG_ are tristate.)
>
> Here's a hacky attempt to look for problems:
>
> rusty@rusty-Lemur:~/devel/kernel/linux (master)$ KCONFIGS=3D`find * -name=
 'Kconfig*'`; for m in `find [b-z]* -name 'Makefile*'`; do sed -n 's,obj-\$=
(CONFIG.*+=3D \([a-z0-9_-]\+\.o\)$,'$m' \1,p' <$m | sort -u; done | sort -k=
 2 | uniq -D -f 1 | while read m obj; do fgrep -w $obj $m /dev/null; done |=
 while read LINE; do conf=3D`echo $LINE | sed 's/.*\$(CONFIG_\([A-Z0-9_]*\)=
.*/\1/'`; if grep -C2 "^config $conf\$" $KCONFIGS | fgrep -q tristate; then=
 echo $LINE; fi; done
>
> Here are the results (mildly filtered by me):
>
[...]

>
> drivers/hwmon/Makefile:obj-$(CONFIG_SENSORS_VEXPRESS) +=3D vexpress.o
> drivers/regulator/Makefile:obj-$(CONFIG_REGULATOR_VEXPRESS) +=3D vexpress=
.o
>

Indeed causes issues if both are built as modules, only once succeeds.
I will post these 2 patches separately soon.

-->8

>From 1eb0d653d90e3f5fe05c6f63a17976226309e1ec Mon Sep 17 00:00:00 2001
From: Sudeep Holla <sudeep.holla@arm.com>
Date: Fri, 29 Jan 2016 15:40:24 +0000
Subject: [PATCH 1/2] hwmon: (vexpress) rename vexpress hwmon implementation

The vexpress hwmon implementation is currently just called vexpress.
This is a problem because it clashes with another module with the same
name in regulators.

This patch renames the vexpress hwmon implementation to vexpress-hwmon
so that there will be no clash in the module namespace.

Reported-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/hwmon/Makefile                         | 2 +-
 drivers/hwmon/{vexpress.c =3D> vexpress-hwmon.c} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename drivers/hwmon/{vexpress.c =3D> vexpress-hwmon.c} (100%)

diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index 30c94df31465..cfc09711810c 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -149,7 +149,7 @@ obj-$(CONFIG_SENSORS_TMP103) +=3D tmp103.o
 obj-$(CONFIG_SENSORS_TMP401) +=3D tmp401.o
 obj-$(CONFIG_SENSORS_TMP421) +=3D tmp421.o
 obj-$(CONFIG_SENSORS_TWL4030_MADC)+=3D twl4030-madc-hwmon.o
-obj-$(CONFIG_SENSORS_VEXPRESS) +=3D vexpress.o
+obj-$(CONFIG_SENSORS_VEXPRESS) +=3D vexpress-hwmon.o
 obj-$(CONFIG_SENSORS_VIA_CPUTEMP)+=3D via-cputemp.o
 obj-$(CONFIG_SENSORS_VIA686A) +=3D via686a.o
 obj-$(CONFIG_SENSORS_VT1211) +=3D vt1211.o
diff --git a/drivers/hwmon/vexpress.c b/drivers/hwmon/vexpress-hwmon.c
similarity index 100%
rename from drivers/hwmon/vexpress.c
rename to drivers/hwmon/vexpress-hwmon.c
--=20
1.9.1

>From 1520bd20d3863df87ca5d9461bf5a20d3f58e385 Mon Sep 17 00:00:00 2001
From: Sudeep Holla <sudeep.holla@arm.com>
Date: Fri, 29 Jan 2016 15:44:50 +0000
Subject: [PATCH 2/2] regulator: vexpress: rename vexpress regulator
 implementation

The vexpress regulator implementation is currently just called vexpress.
This is a problem because it clashes with another module with the same
name in hardware monitors.

This patch renames the vexpress regulator implementation to
vexpress-regulator so that there will be no clash in the module namespace.

Reported-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/regulator/Makefile                             | 2 +-
 drivers/regulator/{vexpress.c =3D> vexpress-regulator.c} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename drivers/regulator/{vexpress.c =3D> vexpress-regulator.c} (100%)

diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 980b1943fa81..755077a89a25 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -98,7 +98,7 @@ obj-$(CONFIG_REGULATOR_TPS65910) +=3D tps65910-regulator.=
o
 obj-$(CONFIG_REGULATOR_TPS65912) +=3D tps65912-regulator.o
 obj-$(CONFIG_REGULATOR_TPS80031) +=3D tps80031-regulator.o
 obj-$(CONFIG_REGULATOR_TWL4030) +=3D twl-regulator.o
-obj-$(CONFIG_REGULATOR_VEXPRESS) +=3D vexpress.o
+obj-$(CONFIG_REGULATOR_VEXPRESS) +=3D vexpress-regulator.o
 obj-$(CONFIG_REGULATOR_WM831X) +=3D wm831x-dcdc.o
 obj-$(CONFIG_REGULATOR_WM831X) +=3D wm831x-isink.o
 obj-$(CONFIG_REGULATOR_WM831X) +=3D wm831x-ldo.o
diff --git a/drivers/regulator/vexpress.c
b/drivers/regulator/vexpress-regulator.c
similarity index 100%
rename from drivers/regulator/vexpress.c
rename to drivers/regulator/vexpress-regulator.c
--=20
1.9.1

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

* Re: Duplicated module names
  2016-01-29  5:54       ` Duplicated module names Rusty Russell
                           ` (2 preceding siblings ...)
  2016-01-29 15:58         ` Sudeep Holla
@ 2016-01-29 19:08         ` Lucas De Marchi
  3 siblings, 0 replies; 9+ messages in thread
From: Lucas De Marchi @ 2016-01-29 19:08 UTC (permalink / raw)
  To: Rusty Russell
  Cc: Samson Yeung, linux-modules, lkml, linux-crypto, David Airlie,
	Tomi Valkeinen, Kyungmin Park, Greg Kroah-Hartman, Liam Girdwood,
	Mark Brown

Hi!

On Fri, Jan 29, 2016 at 3:54 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> Lucas De Marchi <lucas.de.marchi@gmail.com> writes:
>> Hi!
>>
>> CC'ing Rusty and mailing lists
>
> Thanks.
>
>> Rusty and ohers: it looks like both CONFIG_CRC32 and
>> CONFIG_CRYPTO_CRC32 can be compiled as module, and they generate
>> modules with the same name, crc32.  Could that be fixed?
>
> Gah.  Looks like it's been that way since at least 2014, too.
>
> I think we could rename it to crypto_crc32, but I don't think it's the
> only one.  Marco, I think depmod should probably FAIL if two modules
> have the same name, which would at least find such problems.

Yes, I'll do that on kmod, but we need to pay attention to 2 things:

  - It's possible 2 modules with the same names if they come from
different locations (with different priorities)
  - It doesn't fix the case in which one is a module and the other is
builtin. We could still have problem with such a scenario, like was
pointed out in this bug report to kmod.


Lucas De Marchi

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

end of thread, other threads:[~2016-01-29 19:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-27 19:32 modinfo crc32 broken after fd44a98ae2eb Samson Yeung
2016-01-28 19:21 ` Lucas De Marchi
2016-01-28 22:40   ` Samson Yeung
2016-01-29  1:35     ` Lucas De Marchi
2016-01-29  5:54       ` Duplicated module names Rusty Russell
2016-01-29  7:04         ` Tomi Valkeinen
2016-01-29 10:20         ` Herbert Xu
2016-01-29 15:58         ` Sudeep Holla
2016-01-29 19:08         ` Lucas De Marchi

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).