All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the ecryptfs tree
@ 2019-05-14  0:15 Stephen Rothwell
  2019-05-14  0:40 ` Masahiro Yamada
  0 siblings, 1 reply; 22+ messages in thread
From: Stephen Rothwell @ 2019-05-14  0:15 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Tyler Hicks, Linux Next Mailing List, Linux Kernel Mailing List

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

Hi all,

I don't know why this suddenly appeared after mergeing the ecryptfs tree
since nothin has changed in that tree for some time (and nothing in that
tree seems relevant).

After merging the ecryptfs tree, today's linux-next build (x86_64
allmodconfig) failed like this:

scripts/Makefile.modpost:112: target '.tmp_versions/asix.mod' doesn't match the target pattern
scripts/Makefile.modpost:113: warning: overriding recipe for target '.tmp_versions/asix.mod'
scripts/Makefile.modpost:100: warning: ignoring old recipe for target '.tmp_versions/asix.mod'
scripts/Makefile.modpost:127: target '.tmp_versions/asix.mod' doesn't match the target pattern
scripts/Makefile.modpost:128: warning: overriding recipe for target '.tmp_versions/asix.mod'
scripts/Makefile.modpost:113: warning: ignoring old recipe for target '.tmp_versions/asix.mod'
make[2]: Circular .tmp_versions/asix.mod <- __modpost dependency dropped.
Binary file .tmp_versions/asix.mod matches: No such file or directory
make[2]: *** [scripts/Makefile.modpost:91: __modpost] Error 1
make[1]: *** [Makefile:1290: modules] Error 2

The only clue I can see is that asix.o gets built in two separate
directories (drivers/net/{phy,usb}).

I have the following files in the object directory:

./.tmp_versions/asix.mod
./drivers/net/usb/asix.ko
./drivers/net/usb/asix.mod.o
./drivers/net/usb/asix.o
./drivers/net/usb/asix_common.o
./drivers/net/usb/asix_devices.o
./drivers/net/usb/.asix.ko.cmd
./drivers/net/usb/.asix.mod.o.cmd
./drivers/net/usb/.asix.o.cmd
./drivers/net/usb/asix.mod.c
./drivers/net/usb/.asix_common.o.cmd
./drivers/net/usb/.asix_devices.o.cmd
./drivers/net/phy/asix.ko
./drivers/net/phy/asix.o
./drivers/net/phy/.asix.ko.cmd
./drivers/net/phy/.asix.mod.o.cmd
./drivers/net/phy/asix.mod.o
./drivers/net/phy/asix.mod.c
./drivers/net/phy/.asix.o.cmd

./.tmp_versions/asix.mod

Looks like this:

------------------------------------------
drivers/net/phy/asix.ko
drivers/net/phy/asix.o


------------------------------------------

What you can't see above are the 256 NUL bytes at the end of the file
(followed by a NL).

This is from a -j 80 build.  Surely there is a race condition here if the
file in .tmp_versions is only named for the base name of the module and
we have 2 modules with the same base name.

I removed that file and redid the build and it succeeded.

Mind you, I have no itdea why this file was begin rebuilt, the merge
only touched these files:

fs/ecryptfs/crypto.c
fs/ecryptfs/keystore.c

Puzzled ... :-(

-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: build failure after merge of the ecryptfs tree
  2019-05-14  0:15 linux-next: build failure after merge of the ecryptfs tree Stephen Rothwell
@ 2019-05-14  0:40 ` Masahiro Yamada
  2019-05-14  0:56   ` Stephen Rothwell
  2019-05-14  1:03   ` linux-next: build failure after merge of the ecryptfs tree Stephen Rothwell
  0 siblings, 2 replies; 22+ messages in thread
From: Masahiro Yamada @ 2019-05-14  0:40 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Tyler Hicks, Linux Next Mailing List, Linux Kernel Mailing List

Hi Stephen,

On Tue, May 14, 2019 at 9:16 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> I don't know why this suddenly appeared after mergeing the ecryptfs tree
> since nothin has changed in that tree for some time (and nothing in that
> tree seems relevant).
>
> After merging the ecryptfs tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> scripts/Makefile.modpost:112: target '.tmp_versions/asix.mod' doesn't match the target pattern
> scripts/Makefile.modpost:113: warning: overriding recipe for target '.tmp_versions/asix.mod'
> scripts/Makefile.modpost:100: warning: ignoring old recipe for target '.tmp_versions/asix.mod'
> scripts/Makefile.modpost:127: target '.tmp_versions/asix.mod' doesn't match the target pattern
> scripts/Makefile.modpost:128: warning: overriding recipe for target '.tmp_versions/asix.mod'
> scripts/Makefile.modpost:113: warning: ignoring old recipe for target '.tmp_versions/asix.mod'
> make[2]: Circular .tmp_versions/asix.mod <- __modpost dependency dropped.
> Binary file .tmp_versions/asix.mod matches: No such file or directory
> make[2]: *** [scripts/Makefile.modpost:91: __modpost] Error 1
> make[1]: *** [Makefile:1290: modules] Error 2
>
> The only clue I can see is that asix.o gets built in two separate
> directories (drivers/net/{phy,usb}).


Module name should be unique.

If both are compiled as a module,
they have the same module names:

drivers/net/phy/asix.ko
drivers/net/usb/asix.ko


If you see .tmp_version directory,
you will see asix.mod

Perhaps, one overwrote the other,
or it already got broken somehow.

Thanks.




> I have the following files in the object directory:
>
> ./.tmp_versions/asix.mod
> ./drivers/net/usb/asix.ko
> ./drivers/net/usb/asix.mod.o
> ./drivers/net/usb/asix.o
> ./drivers/net/usb/asix_common.o
> ./drivers/net/usb/asix_devices.o
> ./drivers/net/usb/.asix.ko.cmd
> ./drivers/net/usb/.asix.mod.o.cmd
> ./drivers/net/usb/.asix.o.cmd
> ./drivers/net/usb/asix.mod.c
> ./drivers/net/usb/.asix_common.o.cmd
> ./drivers/net/usb/.asix_devices.o.cmd
> ./drivers/net/phy/asix.ko
> ./drivers/net/phy/asix.o
> ./drivers/net/phy/.asix.ko.cmd
> ./drivers/net/phy/.asix.mod.o.cmd
> ./drivers/net/phy/asix.mod.o
> ./drivers/net/phy/asix.mod.c
> ./drivers/net/phy/.asix.o.cmd
>
> ./.tmp_versions/asix.mod
>
> Looks like this:
>
> ------------------------------------------
> drivers/net/phy/asix.ko
> drivers/net/phy/asix.o
>
>
> ------------------------------------------
>
> What you can't see above are the 256 NUL bytes at the end of the file
> (followed by a NL).
>
> This is from a -j 80 build.  Surely there is a race condition here if the
> file in .tmp_versions is only named for the base name of the module and
> we have 2 modules with the same base name.
>
> I removed that file and redid the build and it succeeded.
>
> Mind you, I have no itdea why this file was begin rebuilt, the merge
> only touched these files:
>
> fs/ecryptfs/crypto.c
> fs/ecryptfs/keystore.c
>
> Puzzled ... :-(
>
> --
> Cheers,
> Stephen Rothwell



-- 
Best Regards
Masahiro Yamada

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

* Re: linux-next: build failure after merge of the ecryptfs tree
  2019-05-14  0:40 ` Masahiro Yamada
@ 2019-05-14  0:56   ` Stephen Rothwell
  2019-05-14  1:22     ` Michael Schmitz
                       ` (6 more replies)
  2019-05-14  1:03   ` linux-next: build failure after merge of the ecryptfs tree Stephen Rothwell
  1 sibling, 7 replies; 22+ messages in thread
From: Stephen Rothwell @ 2019-05-14  0:56 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Tyler Hicks, Linux Next Mailing List, Linux Kernel Mailing List,
	Michael Schmitz, David S. Miller

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

Hi all,

[excessive quoting for new CC's]

On Tue, 14 May 2019 09:40:53 +0900 Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>
> On Tue, May 14, 2019 at 9:16 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > I don't know why this suddenly appeared after mergeing the ecryptfs tree
> > since nothin has changed in that tree for some time (and nothing in that
> > tree seems relevant).
> >
> > After merging the ecryptfs tree, today's linux-next build (x86_64
> > allmodconfig) failed like this:
> >
> > scripts/Makefile.modpost:112: target '.tmp_versions/asix.mod' doesn't match the target pattern
> > scripts/Makefile.modpost:113: warning: overriding recipe for target '.tmp_versions/asix.mod'
> > scripts/Makefile.modpost:100: warning: ignoring old recipe for target '.tmp_versions/asix.mod'
> > scripts/Makefile.modpost:127: target '.tmp_versions/asix.mod' doesn't match the target pattern
> > scripts/Makefile.modpost:128: warning: overriding recipe for target '.tmp_versions/asix.mod'
> > scripts/Makefile.modpost:113: warning: ignoring old recipe for target '.tmp_versions/asix.mod'
> > make[2]: Circular .tmp_versions/asix.mod <- __modpost dependency dropped.
> > Binary file .tmp_versions/asix.mod matches: No such file or directory
> > make[2]: *** [scripts/Makefile.modpost:91: __modpost] Error 1
> > make[1]: *** [Makefile:1290: modules] Error 2
> >
> > The only clue I can see is that asix.o gets built in two separate
> > directories (drivers/net/{phy,usb}).  
> 
> Module name should be unique.
> 
> If both are compiled as a module,
> they have the same module names:
> 
> drivers/net/phy/asix.ko
> drivers/net/usb/asix.ko
> 
> If you see .tmp_version directory,
> you will see asix.mod
> 
> Perhaps, one overwrote the other,
> or it already got broken somehow.

So, the latter of these drivers (drivers/net/phy/asix.c) was added in
v4.18-rc1 by commit

  31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")

If we can't have 2 modules with the same base name, is it too late to
change its name?

I am sort of suprised that noone else has hit this in the past year.

> > I have the following files in the object directory:
> >
> > ./.tmp_versions/asix.mod
> > ./drivers/net/usb/asix.ko
> > ./drivers/net/usb/asix.mod.o
> > ./drivers/net/usb/asix.o
> > ./drivers/net/usb/asix_common.o
> > ./drivers/net/usb/asix_devices.o
> > ./drivers/net/usb/.asix.ko.cmd
> > ./drivers/net/usb/.asix.mod.o.cmd
> > ./drivers/net/usb/.asix.o.cmd
> > ./drivers/net/usb/asix.mod.c
> > ./drivers/net/usb/.asix_common.o.cmd
> > ./drivers/net/usb/.asix_devices.o.cmd
> > ./drivers/net/phy/asix.ko
> > ./drivers/net/phy/asix.o
> > ./drivers/net/phy/.asix.ko.cmd
> > ./drivers/net/phy/.asix.mod.o.cmd
> > ./drivers/net/phy/asix.mod.o
> > ./drivers/net/phy/asix.mod.c
> > ./drivers/net/phy/.asix.o.cmd
> >
> > ./.tmp_versions/asix.mod
> >
> > Looks like this:
> >
> > ------------------------------------------
> > drivers/net/phy/asix.ko
> > drivers/net/phy/asix.o
> >
> >
> > ------------------------------------------
> >
> > What you can't see above are the 256 NUL bytes at the end of the file
> > (followed by a NL).
> >
> > This is from a -j 80 build.  Surely there is a race condition here if the
> > file in .tmp_versions is only named for the base name of the module and
> > we have 2 modules with the same base name.
> >
> > I removed that file and redid the build and it succeeded.
> >
> > Mind you, I have no itdea why this file was begin rebuilt, the merge
> > only touched these files:
> >
> > fs/ecryptfs/crypto.c
> > fs/ecryptfs/keystore.c
> >
> > Puzzled ... :-(

-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: build failure after merge of the ecryptfs tree
  2019-05-14  0:40 ` Masahiro Yamada
  2019-05-14  0:56   ` Stephen Rothwell
@ 2019-05-14  1:03   ` Stephen Rothwell
  2019-05-14  4:16     ` Masahiro Yamada
  1 sibling, 1 reply; 22+ messages in thread
From: Stephen Rothwell @ 2019-05-14  1:03 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Next Mailing List, Linux Kernel Mailing List

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

Hi Masahiro,

Also, this:

On Tue, 14 May 2019 09:40:53 +0900 Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>
> > Mind you, I have no itdea why this file was begin rebuilt, the merge
> > only touched these files:
> >
> > fs/ecryptfs/crypto.c
> > fs/ecryptfs/keystore.c

Its a bit annoying that the module was even being looked at given
nothing it files depend upon had been modified.
-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: build failure after merge of the ecryptfs tree
  2019-05-14  0:56   ` Stephen Rothwell
@ 2019-05-14  1:22     ` Michael Schmitz
  2019-05-15  4:28       ` Michael Schmitz
  2019-05-17 20:25     ` [PATCH 0/3] resolve module name conflict for asix PHY and USB modules Michael Schmitz
                       ` (5 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Michael Schmitz @ 2019-05-14  1:22 UTC (permalink / raw)
  To: Stephen Rothwell, Masahiro Yamada
  Cc: Tyler Hicks, Linux Next Mailing List, Linux Kernel Mailing List,
	David S. Miller

Stephen,

I wasn't aware of the other asix module when submitting the phy driver. 
The phy module gets autoloaded based on the PHY ID, so there's no reason 
why it couldn't be renamed.

May I suggest ax88796b for the new module name?

Cheers,

     Michael



On 14/05/19 12:56 PM, Stephen Rothwell wrote:
> Hi all,
>
> [excessive quoting for new CC's]
>
> On Tue, 14 May 2019 09:40:53 +0900 Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>> On Tue, May 14, 2019 at 9:16 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>>> I don't know why this suddenly appeared after mergeing the ecryptfs tree
>>> since nothin has changed in that tree for some time (and nothing in that
>>> tree seems relevant).
>>>
>>> After merging the ecryptfs tree, today's linux-next build (x86_64
>>> allmodconfig) failed like this:
>>>
>>> scripts/Makefile.modpost:112: target '.tmp_versions/asix.mod' doesn't match the target pattern
>>> scripts/Makefile.modpost:113: warning: overriding recipe for target '.tmp_versions/asix.mod'
>>> scripts/Makefile.modpost:100: warning: ignoring old recipe for target '.tmp_versions/asix.mod'
>>> scripts/Makefile.modpost:127: target '.tmp_versions/asix.mod' doesn't match the target pattern
>>> scripts/Makefile.modpost:128: warning: overriding recipe for target '.tmp_versions/asix.mod'
>>> scripts/Makefile.modpost:113: warning: ignoring old recipe for target '.tmp_versions/asix.mod'
>>> make[2]: Circular .tmp_versions/asix.mod <- __modpost dependency dropped.
>>> Binary file .tmp_versions/asix.mod matches: No such file or directory
>>> make[2]: *** [scripts/Makefile.modpost:91: __modpost] Error 1
>>> make[1]: *** [Makefile:1290: modules] Error 2
>>>
>>> The only clue I can see is that asix.o gets built in two separate
>>> directories (drivers/net/{phy,usb}).
>> Module name should be unique.
>>
>> If both are compiled as a module,
>> they have the same module names:
>>
>> drivers/net/phy/asix.ko
>> drivers/net/usb/asix.ko
>>
>> If you see .tmp_version directory,
>> you will see asix.mod
>>
>> Perhaps, one overwrote the other,
>> or it already got broken somehow.
> So, the latter of these drivers (drivers/net/phy/asix.c) was added in
> v4.18-rc1 by commit
>
>    31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
>
> If we can't have 2 modules with the same base name, is it too late to
> change its name?
>
> I am sort of suprised that noone else has hit this in the past year.
>
>>> I have the following files in the object directory:
>>>
>>> ./.tmp_versions/asix.mod
>>> ./drivers/net/usb/asix.ko
>>> ./drivers/net/usb/asix.mod.o
>>> ./drivers/net/usb/asix.o
>>> ./drivers/net/usb/asix_common.o
>>> ./drivers/net/usb/asix_devices.o
>>> ./drivers/net/usb/.asix.ko.cmd
>>> ./drivers/net/usb/.asix.mod.o.cmd
>>> ./drivers/net/usb/.asix.o.cmd
>>> ./drivers/net/usb/asix.mod.c
>>> ./drivers/net/usb/.asix_common.o.cmd
>>> ./drivers/net/usb/.asix_devices.o.cmd
>>> ./drivers/net/phy/asix.ko
>>> ./drivers/net/phy/asix.o
>>> ./drivers/net/phy/.asix.ko.cmd
>>> ./drivers/net/phy/.asix.mod.o.cmd
>>> ./drivers/net/phy/asix.mod.o
>>> ./drivers/net/phy/asix.mod.c
>>> ./drivers/net/phy/.asix.o.cmd
>>>
>>> ./.tmp_versions/asix.mod
>>>
>>> Looks like this:
>>>
>>> ------------------------------------------
>>> drivers/net/phy/asix.ko
>>> drivers/net/phy/asix.o
>>>
>>>
>>> ------------------------------------------
>>>
>>> What you can't see above are the 256 NUL bytes at the end of the file
>>> (followed by a NL).
>>>
>>> This is from a -j 80 build.  Surely there is a race condition here if the
>>> file in .tmp_versions is only named for the base name of the module and
>>> we have 2 modules with the same base name.
>>>
>>> I removed that file and redid the build and it succeeded.
>>>
>>> Mind you, I have no itdea why this file was begin rebuilt, the merge
>>> only touched these files:
>>>
>>> fs/ecryptfs/crypto.c
>>> fs/ecryptfs/keystore.c
>>>
>>> Puzzled ... :-(

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

* Re: linux-next: build failure after merge of the ecryptfs tree
  2019-05-14  1:03   ` linux-next: build failure after merge of the ecryptfs tree Stephen Rothwell
@ 2019-05-14  4:16     ` Masahiro Yamada
  2019-05-14  4:49       ` Stephen Rothwell
  0 siblings, 1 reply; 22+ messages in thread
From: Masahiro Yamada @ 2019-05-14  4:16 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Linux Next Mailing List, Linux Kernel Mailing List

Hi Stephen,

On Tue, May 14, 2019 at 10:04 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi Masahiro,
>
> Also, this:
>
> On Tue, 14 May 2019 09:40:53 +0900 Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> >
> > > Mind you, I have no itdea why this file was begin rebuilt, the merge
> > > only touched these files:
> > >
> > > fs/ecryptfs/crypto.c
> > > fs/ecryptfs/keystore.c
>
> Its a bit annoying that the module was even being looked at given
> nothing it files depend upon had been modified.


If you are talking about the rebuild of
.tmp_versions/*.mod files,
yes, they are cleaned up every time.

# Create temporary dir for module support files
# clean it up only when building all modules
cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \
                  $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*)


I think the reason is that
we want to make sure stale modules are not remaining
when CONFIG_MY_DRIVER=m is turned into CONFIG_MY_DRIVER=n


Rebuilding .mod files is not expensive.

I think this behavior can be improved, but
that is how it has been working for a long time.


--
Best Regards
Masahiro Yamada

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

* Re: linux-next: build failure after merge of the ecryptfs tree
  2019-05-14  4:16     ` Masahiro Yamada
@ 2019-05-14  4:49       ` Stephen Rothwell
  0 siblings, 0 replies; 22+ messages in thread
From: Stephen Rothwell @ 2019-05-14  4:49 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Next Mailing List, Linux Kernel Mailing List

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

Hi Masahiro,

On Tue, 14 May 2019 13:16:37 +0900 Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
>
> If you are talking about the rebuild of
> .tmp_versions/*.mod files,
> yes, they are cleaned up every time.
> 
> # Create temporary dir for module support files
> # clean it up only when building all modules
> cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \
>                   $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*)
> 
> 
> I think the reason is that
> we want to make sure stale modules are not remaining
> when CONFIG_MY_DRIVER=m is turned into CONFIG_MY_DRIVER=n
> 
> 
> Rebuilding .mod files is not expensive.
> 
> I think this behavior can be improved, but
> that is how it has been working for a long time.

when you say "not expensive", how long is that?  Because an x86_64
allmodconfig build currently produces 7313 of those files, so at .01
seconds each (for example) that would add over a minute to each of my
builds ... and I do lots of builds every day.  OK, so it may not be
that significant (so a millisecond each is obviously not a problem),
but just wondering if it can be avoided.

-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: build failure after merge of the ecryptfs tree
  2019-05-14  1:22     ` Michael Schmitz
@ 2019-05-15  4:28       ` Michael Schmitz
  0 siblings, 0 replies; 22+ messages in thread
From: Michael Schmitz @ 2019-05-15  4:28 UTC (permalink / raw)
  To: Stephen Rothwell, Masahiro Yamada, David S. Miller
  Cc: Tyler Hicks, Linux Next Mailing List, Linux Kernel Mailing List

Hi,

Am 14.05.2019 um 13:22 schrieb Michael Schmitz:
> Stephen,
>
> I wasn't aware of the other asix module when submitting the phy driver.
> The phy module gets autoloaded based on the PHY ID, so there's no reason
> why it couldn't be renamed.
>
> May I suggest ax88796b for the new module name?

I've got a patch series ready to go for this (compile tested).

I suppose this is meant to go through the net tree, Dave?

Cheers,

	Michael


>
> Cheers,
>
>     Michael
>
>
>
> On 14/05/19 12:56 PM, Stephen Rothwell wrote:
>> Hi all,
>>
>> [excessive quoting for new CC's]
>>
>> On Tue, 14 May 2019 09:40:53 +0900 Masahiro Yamada
>> <yamada.masahiro@socionext.com> wrote:
>>> On Tue, May 14, 2019 at 9:16 AM Stephen Rothwell
>>> <sfr@canb.auug.org.au> wrote:
>>>> I don't know why this suddenly appeared after mergeing the ecryptfs
>>>> tree
>>>> since nothin has changed in that tree for some time (and nothing in
>>>> that
>>>> tree seems relevant).
>>>>
>>>> After merging the ecryptfs tree, today's linux-next build (x86_64
>>>> allmodconfig) failed like this:
>>>>
>>>> scripts/Makefile.modpost:112: target '.tmp_versions/asix.mod'
>>>> doesn't match the target pattern
>>>> scripts/Makefile.modpost:113: warning: overriding recipe for target
>>>> '.tmp_versions/asix.mod'
>>>> scripts/Makefile.modpost:100: warning: ignoring old recipe for
>>>> target '.tmp_versions/asix.mod'
>>>> scripts/Makefile.modpost:127: target '.tmp_versions/asix.mod'
>>>> doesn't match the target pattern
>>>> scripts/Makefile.modpost:128: warning: overriding recipe for target
>>>> '.tmp_versions/asix.mod'
>>>> scripts/Makefile.modpost:113: warning: ignoring old recipe for
>>>> target '.tmp_versions/asix.mod'
>>>> make[2]: Circular .tmp_versions/asix.mod <- __modpost dependency
>>>> dropped.
>>>> Binary file .tmp_versions/asix.mod matches: No such file or directory
>>>> make[2]: *** [scripts/Makefile.modpost:91: __modpost] Error 1
>>>> make[1]: *** [Makefile:1290: modules] Error 2
>>>>
>>>> The only clue I can see is that asix.o gets built in two separate
>>>> directories (drivers/net/{phy,usb}).
>>> Module name should be unique.
>>>
>>> If both are compiled as a module,
>>> they have the same module names:
>>>
>>> drivers/net/phy/asix.ko
>>> drivers/net/usb/asix.ko
>>>
>>> If you see .tmp_version directory,
>>> you will see asix.mod
>>>
>>> Perhaps, one overwrote the other,
>>> or it already got broken somehow.
>> So, the latter of these drivers (drivers/net/phy/asix.c) was added in
>> v4.18-rc1 by commit
>>
>>    31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
>>
>> If we can't have 2 modules with the same base name, is it too late to
>> change its name?
>>
>> I am sort of suprised that noone else has hit this in the past year.
>>
>>>> I have the following files in the object directory:
>>>>
>>>> ./.tmp_versions/asix.mod
>>>> ./drivers/net/usb/asix.ko
>>>> ./drivers/net/usb/asix.mod.o
>>>> ./drivers/net/usb/asix.o
>>>> ./drivers/net/usb/asix_common.o
>>>> ./drivers/net/usb/asix_devices.o
>>>> ./drivers/net/usb/.asix.ko.cmd
>>>> ./drivers/net/usb/.asix.mod.o.cmd
>>>> ./drivers/net/usb/.asix.o.cmd
>>>> ./drivers/net/usb/asix.mod.c
>>>> ./drivers/net/usb/.asix_common.o.cmd
>>>> ./drivers/net/usb/.asix_devices.o.cmd
>>>> ./drivers/net/phy/asix.ko
>>>> ./drivers/net/phy/asix.o
>>>> ./drivers/net/phy/.asix.ko.cmd
>>>> ./drivers/net/phy/.asix.mod.o.cmd
>>>> ./drivers/net/phy/asix.mod.o
>>>> ./drivers/net/phy/asix.mod.c
>>>> ./drivers/net/phy/.asix.o.cmd
>>>>
>>>> ./.tmp_versions/asix.mod
>>>>
>>>> Looks like this:
>>>>
>>>> ------------------------------------------
>>>> drivers/net/phy/asix.ko
>>>> drivers/net/phy/asix.o
>>>>
>>>>
>>>> ------------------------------------------
>>>>
>>>> What you can't see above are the 256 NUL bytes at the end of the file
>>>> (followed by a NL).
>>>>
>>>> This is from a -j 80 build.  Surely there is a race condition here
>>>> if the
>>>> file in .tmp_versions is only named for the base name of the module and
>>>> we have 2 modules with the same base name.
>>>>
>>>> I removed that file and redid the build and it succeeded.
>>>>
>>>> Mind you, I have no itdea why this file was begin rebuilt, the merge
>>>> only touched these files:
>>>>
>>>> fs/ecryptfs/crypto.c
>>>> fs/ecryptfs/keystore.c
>>>>
>>>> Puzzled ... :-(

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

* [PATCH 0/3] resolve module name conflict for asix PHY and USB modules
  2019-05-14  0:56   ` Stephen Rothwell
  2019-05-14  1:22     ` Michael Schmitz
@ 2019-05-17 20:25     ` Michael Schmitz
  2019-05-17 21:20       ` Andrew Lunn
  2019-05-17 20:25     ` [PATCH 1/3] net: phy: new ax88796b.c Asix Electronics PHY driver Michael Schmitz
                       ` (4 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Michael Schmitz @ 2019-05-17 20:25 UTC (permalink / raw)
  To: netdev, netdev; +Cc: schmitz, Michael Schmitz, sfr, davem

Haven't heard back in a while, so here goes: 

Commit 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
introduced a new PHY driver drivers/net/phy/asix.c that causes a module
name conflict with a pre-existiting driver (drivers/net/usb/asix.c). 

The PHY driver is used by the X-Surf 100 ethernet card driver, and loaded
by that driver via its PHY ID. A rename of the driver looks unproblematic.
 
Rename PHY driver to ax88796b.c in order to resolve name conflict. 

Fixes: 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")

Michael Schmitz (3):
  net: phy: new ax88796b.c Asix Electronics PHY driver
  net: 8390: switch X-Surf 100 driver to use ax88796b PHY
  net: phy: remove old Asix Electronics PHY driver

 drivers/net/ethernet/8390/Kconfig |  2 +-
 drivers/net/phy/Kconfig           |  2 +-
 drivers/net/phy/Makefile          |  2 +-
 drivers/net/phy/asix.c            | 57 ---------------------------------------
 drivers/net/phy/ax88796b.c        | 57 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 60 insertions(+), 60 deletions(-)
 delete mode 100644 drivers/net/phy/asix.c
 create mode 100644 drivers/net/phy/ax88796b.c

-- 
1.9.1


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

* [PATCH 1/3] net: phy: new ax88796b.c Asix Electronics PHY driver
  2019-05-14  0:56   ` Stephen Rothwell
  2019-05-14  1:22     ` Michael Schmitz
  2019-05-17 20:25     ` [PATCH 0/3] resolve module name conflict for asix PHY and USB modules Michael Schmitz
@ 2019-05-17 20:25     ` Michael Schmitz
  2019-05-17 20:25     ` [PATCH 2/3] net: 8390: switch X-Surf 100 driver to use ax88796b PHY Michael Schmitz
                       ` (3 subsequent siblings)
  6 siblings, 0 replies; 22+ messages in thread
From: Michael Schmitz @ 2019-05-17 20:25 UTC (permalink / raw)
  To: netdev, netdev; +Cc: schmitz, Michael Schmitz, sfr, davem

The asix.c driver name causes a module name conflict with a driver
of the same name in drivers/net/usb. Add new ax88796b.c driver to
prepare for removal of drivers/net/phy/asix.c later.

Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
Fixes: 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
---
 drivers/net/phy/Kconfig    |  6 +++++
 drivers/net/phy/Makefile   |  1 +
 drivers/net/phy/ax88796b.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 64 insertions(+)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index d629971..1647473 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -259,6 +259,12 @@ config ASIX_PHY
 	  Currently supports the Asix Electronics PHY found in the X-Surf 100
 	  AX88796B package.
 
+config AX88796B_PHY
+	tristate "Asix PHYs"
+	help
+	  Currently supports the Asix Electronics PHY found in the X-Surf 100
+	  AX88796B package.
+
 config AT803X_PHY
 	tristate "AT803X PHYs"
 	---help---
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index 27d7f9f..cc5758a 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -53,6 +53,7 @@ aquantia-objs			+= aquantia_hwmon.o
 endif
 obj-$(CONFIG_AQUANTIA_PHY)	+= aquantia.o
 obj-$(CONFIG_ASIX_PHY)		+= asix.o
+obj-$(CONFIG_AX88796B_PHY)	+= ax88796b.o
 obj-$(CONFIG_AT803X_PHY)	+= at803x.o
 obj-$(CONFIG_BCM63XX_PHY)	+= bcm63xx.o
 obj-$(CONFIG_BCM7XXX_PHY)	+= bcm7xxx.o
diff --git a/drivers/net/phy/ax88796b.c b/drivers/net/phy/ax88796b.c
new file mode 100644
index 0000000..79bf7ef
--- /dev/null
+++ b/drivers/net/phy/ax88796b.c
@@ -0,0 +1,57 @@
+// SPDX-License-Identifier: GPL-2.0+
+/* Driver for Asix PHYs
+ *
+ * Author: Michael Schmitz <schmitzmic@gmail.com>
+ */
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/mii.h>
+#include <linux/phy.h>
+
+#define PHY_ID_ASIX_AX88796B		0x003b1841
+
+MODULE_DESCRIPTION("Asix PHY driver");
+MODULE_AUTHOR("Michael Schmitz <schmitzmic@gmail.com>");
+MODULE_LICENSE("GPL");
+
+/**
+ * asix_soft_reset - software reset the PHY via BMCR_RESET bit
+ * @phydev: target phy_device struct
+ *
+ * Description: Perform a software PHY reset using the standard
+ * BMCR_RESET bit and poll for the reset bit to be cleared.
+ * Toggle BMCR_RESET bit off to accommodate broken AX8796B PHY implementation
+ * such as used on the Individual Computers' X-Surf 100 Zorro card.
+ *
+ * Returns: 0 on success, < 0 on failure
+ */
+static int asix_soft_reset(struct phy_device *phydev)
+{
+	int ret;
+
+	/* Asix PHY won't reset unless reset bit toggles */
+	ret = phy_write(phydev, MII_BMCR, 0);
+	if (ret < 0)
+		return ret;
+
+	return genphy_soft_reset(phydev);
+}
+
+static struct phy_driver asix_driver[] = { {
+	.phy_id		= PHY_ID_ASIX_AX88796B,
+	.name		= "Asix Electronics AX88796B",
+	.phy_id_mask	= 0xfffffff0,
+	/* PHY_BASIC_FEATURES */
+	.soft_reset	= asix_soft_reset,
+} };
+
+module_phy_driver(asix_driver);
+
+static struct mdio_device_id __maybe_unused asix_tbl[] = {
+	{ PHY_ID_ASIX_AX88796B, 0xfffffff0 },
+	{ }
+};
+
+MODULE_DEVICE_TABLE(mdio, asix_tbl);
-- 
1.9.1


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

* [PATCH 2/3] net: 8390: switch X-Surf 100 driver to use ax88796b PHY
  2019-05-14  0:56   ` Stephen Rothwell
                       ` (2 preceding siblings ...)
  2019-05-17 20:25     ` [PATCH 1/3] net: phy: new ax88796b.c Asix Electronics PHY driver Michael Schmitz
@ 2019-05-17 20:25     ` Michael Schmitz
  2019-05-17 20:25     ` [PATCH 3/3] net: phy: remove old Asix Electronics PHY driver Michael Schmitz
                       ` (2 subsequent siblings)
  6 siblings, 0 replies; 22+ messages in thread
From: Michael Schmitz @ 2019-05-17 20:25 UTC (permalink / raw)
  To: netdev, netdev; +Cc: schmitz, Michael Schmitz, sfr, davem

The asix.c driver name causes a module name conflict with a driver
of the same name in drivers/net/usb. Select the new ax88796b PHY
driver when X-SURF 100 support is configured.

Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
Fixes: 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
---
 drivers/net/ethernet/8390/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/8390/Kconfig b/drivers/net/ethernet/8390/Kconfig
index f2f0264..443b34e 100644
--- a/drivers/net/ethernet/8390/Kconfig
+++ b/drivers/net/ethernet/8390/Kconfig
@@ -49,7 +49,7 @@ config XSURF100
 	tristate "Amiga XSurf 100 AX88796/NE2000 clone support"
 	depends on ZORRO
 	select AX88796
-	select ASIX_PHY
+	select AX88796B_PHY
 	help
 	  This driver is for the Individual Computers X-Surf 100 Ethernet
 	  card (based on the Asix AX88796 chip). If you have such a card,
-- 
1.9.1


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

* [PATCH 3/3] net: phy: remove old Asix Electronics PHY driver
  2019-05-14  0:56   ` Stephen Rothwell
                       ` (3 preceding siblings ...)
  2019-05-17 20:25     ` [PATCH 2/3] net: 8390: switch X-Surf 100 driver to use ax88796b PHY Michael Schmitz
@ 2019-05-17 20:25     ` Michael Schmitz
  2019-05-18  1:14     ` [PATCH v2] net: phy: rename " Michael Schmitz
  2019-06-07  5:37     ` [PATCH net v3] " Michael Schmitz
  6 siblings, 0 replies; 22+ messages in thread
From: Michael Schmitz @ 2019-05-17 20:25 UTC (permalink / raw)
  To: netdev, netdev; +Cc: schmitz, Michael Schmitz, sfr, davem

The asix.c driver name causes a module name conflict with a driver
of the same name in drivers/net/usb. Now that a new ax88796b.c driver
has been added, remove drivers/net/phy/asix.c.

Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
Fixes: 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
---
 drivers/net/phy/Kconfig  |  6 -----
 drivers/net/phy/Makefile |  1 -
 drivers/net/phy/asix.c   | 57 ------------------------------------------------
 3 files changed, 64 deletions(-)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index 1647473..5496e5c 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -253,12 +253,6 @@ config AQUANTIA_PHY
 	---help---
 	  Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405
 
-config ASIX_PHY
-	tristate "Asix PHYs"
-	help
-	  Currently supports the Asix Electronics PHY found in the X-Surf 100
-	  AX88796B package.
-
 config AX88796B_PHY
 	tristate "Asix PHYs"
 	help
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index cc5758a..5b5c866 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -52,7 +52,6 @@ ifdef CONFIG_HWMON
 aquantia-objs			+= aquantia_hwmon.o
 endif
 obj-$(CONFIG_AQUANTIA_PHY)	+= aquantia.o
-obj-$(CONFIG_ASIX_PHY)		+= asix.o
 obj-$(CONFIG_AX88796B_PHY)	+= ax88796b.o
 obj-$(CONFIG_AT803X_PHY)	+= at803x.o
 obj-$(CONFIG_BCM63XX_PHY)	+= bcm63xx.o
diff --git a/drivers/net/phy/asix.c b/drivers/net/phy/asix.c
deleted file mode 100644
index 79bf7ef..0000000
--- a/drivers/net/phy/asix.c
+++ /dev/null
@@ -1,57 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/* Driver for Asix PHYs
- *
- * Author: Michael Schmitz <schmitzmic@gmail.com>
- */
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/mii.h>
-#include <linux/phy.h>
-
-#define PHY_ID_ASIX_AX88796B		0x003b1841
-
-MODULE_DESCRIPTION("Asix PHY driver");
-MODULE_AUTHOR("Michael Schmitz <schmitzmic@gmail.com>");
-MODULE_LICENSE("GPL");
-
-/**
- * asix_soft_reset - software reset the PHY via BMCR_RESET bit
- * @phydev: target phy_device struct
- *
- * Description: Perform a software PHY reset using the standard
- * BMCR_RESET bit and poll for the reset bit to be cleared.
- * Toggle BMCR_RESET bit off to accommodate broken AX8796B PHY implementation
- * such as used on the Individual Computers' X-Surf 100 Zorro card.
- *
- * Returns: 0 on success, < 0 on failure
- */
-static int asix_soft_reset(struct phy_device *phydev)
-{
-	int ret;
-
-	/* Asix PHY won't reset unless reset bit toggles */
-	ret = phy_write(phydev, MII_BMCR, 0);
-	if (ret < 0)
-		return ret;
-
-	return genphy_soft_reset(phydev);
-}
-
-static struct phy_driver asix_driver[] = { {
-	.phy_id		= PHY_ID_ASIX_AX88796B,
-	.name		= "Asix Electronics AX88796B",
-	.phy_id_mask	= 0xfffffff0,
-	/* PHY_BASIC_FEATURES */
-	.soft_reset	= asix_soft_reset,
-} };
-
-module_phy_driver(asix_driver);
-
-static struct mdio_device_id __maybe_unused asix_tbl[] = {
-	{ PHY_ID_ASIX_AX88796B, 0xfffffff0 },
-	{ }
-};
-
-MODULE_DEVICE_TABLE(mdio, asix_tbl);
-- 
1.9.1


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

* Re: [PATCH 0/3] resolve module name conflict for asix PHY and USB modules
  2019-05-17 20:25     ` [PATCH 0/3] resolve module name conflict for asix PHY and USB modules Michael Schmitz
@ 2019-05-17 21:20       ` Andrew Lunn
  2019-05-18  1:17         ` Michael Schmitz
  0 siblings, 1 reply; 22+ messages in thread
From: Andrew Lunn @ 2019-05-17 21:20 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: netdev, schmitz, sfr, davem

On Sat, May 18, 2019 at 08:25:15AM +1200, Michael Schmitz wrote:
> Haven't heard back in a while, so here goes: 
> 
> Commit 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
> introduced a new PHY driver drivers/net/phy/asix.c that causes a module
> name conflict with a pre-existiting driver (drivers/net/usb/asix.c). 
> 
> The PHY driver is used by the X-Surf 100 ethernet card driver, and loaded
> by that driver via its PHY ID. A rename of the driver looks unproblematic.
>  
> Rename PHY driver to ax88796b.c in order to resolve name conflict. 

Hi Michael

Please just use git mv and do it all one patch. It then makes it clear
you have not changed the driver, just renamed it.

Thanks
	Andrew

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

* [PATCH v2] net: phy: rename Asix Electronics PHY driver
  2019-05-14  0:56   ` Stephen Rothwell
                       ` (4 preceding siblings ...)
  2019-05-17 20:25     ` [PATCH 3/3] net: phy: remove old Asix Electronics PHY driver Michael Schmitz
@ 2019-05-18  1:14     ` Michael Schmitz
  2019-05-18 14:20       ` Andrew Lunn
  2019-06-07  5:37     ` [PATCH net v3] " Michael Schmitz
  6 siblings, 1 reply; 22+ messages in thread
From: Michael Schmitz @ 2019-05-18  1:14 UTC (permalink / raw)
  To: netdev, netdev; +Cc: schmitz, Michael Schmitz, andrew, davem, sfr

Commit 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
introduced a new PHY driver drivers/net/phy/asix.c that causes a module
name conflict with a pre-existiting driver (drivers/net/usb/asix.c).

The PHY driver is used by the X-Surf 100 ethernet card driver, and loaded
by that driver via its PHY ID. A rename of the driver looks unproblematic.

Rename PHY driver to ax88796b.c in order to resolve name conflict.

Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
Fixes: 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
---

Changes from v1:

- merge into single commit (suggested by Andrew Lunn)
---
 drivers/net/ethernet/8390/Kconfig |  2 +-
 drivers/net/phy/Kconfig           |  2 +-
 drivers/net/phy/Makefile          |  2 +-
 drivers/net/phy/asix.c            | 57 ---------------------------------------
 drivers/net/phy/ax88796b.c        | 57 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 60 insertions(+), 60 deletions(-)

diff --git a/drivers/net/ethernet/8390/Kconfig b/drivers/net/ethernet/8390/Kconfig
index f2f0264..443b34e 100644
--- a/drivers/net/ethernet/8390/Kconfig
+++ b/drivers/net/ethernet/8390/Kconfig
@@ -49,7 +49,7 @@ config XSURF100
 	tristate "Amiga XSurf 100 AX88796/NE2000 clone support"
 	depends on ZORRO
 	select AX88796
-	select ASIX_PHY
+	select AX88796B_PHY
 	help
 	  This driver is for the Individual Computers X-Surf 100 Ethernet
 	  card (based on the Asix AX88796 chip). If you have such a card,
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index d629971..5496e5c 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -253,7 +253,7 @@ config AQUANTIA_PHY
 	---help---
 	  Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405
 
-config ASIX_PHY
+config AX88796B_PHY
 	tristate "Asix PHYs"
 	help
 	  Currently supports the Asix Electronics PHY found in the X-Surf 100
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index 27d7f9f..5b5c866 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -52,7 +52,7 @@ ifdef CONFIG_HWMON
 aquantia-objs			+= aquantia_hwmon.o
 endif
 obj-$(CONFIG_AQUANTIA_PHY)	+= aquantia.o
-obj-$(CONFIG_ASIX_PHY)		+= asix.o
+obj-$(CONFIG_AX88796B_PHY)	+= ax88796b.o
 obj-$(CONFIG_AT803X_PHY)	+= at803x.o
 obj-$(CONFIG_BCM63XX_PHY)	+= bcm63xx.o
 obj-$(CONFIG_BCM7XXX_PHY)	+= bcm7xxx.o
diff --git a/drivers/net/phy/asix.c b/drivers/net/phy/asix.c
deleted file mode 100644
index 79bf7ef..0000000
--- a/drivers/net/phy/asix.c
+++ /dev/null
@@ -1,57 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/* Driver for Asix PHYs
- *
- * Author: Michael Schmitz <schmitzmic@gmail.com>
- */
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/mii.h>
-#include <linux/phy.h>
-
-#define PHY_ID_ASIX_AX88796B		0x003b1841
-
-MODULE_DESCRIPTION("Asix PHY driver");
-MODULE_AUTHOR("Michael Schmitz <schmitzmic@gmail.com>");
-MODULE_LICENSE("GPL");
-
-/**
- * asix_soft_reset - software reset the PHY via BMCR_RESET bit
- * @phydev: target phy_device struct
- *
- * Description: Perform a software PHY reset using the standard
- * BMCR_RESET bit and poll for the reset bit to be cleared.
- * Toggle BMCR_RESET bit off to accommodate broken AX8796B PHY implementation
- * such as used on the Individual Computers' X-Surf 100 Zorro card.
- *
- * Returns: 0 on success, < 0 on failure
- */
-static int asix_soft_reset(struct phy_device *phydev)
-{
-	int ret;
-
-	/* Asix PHY won't reset unless reset bit toggles */
-	ret = phy_write(phydev, MII_BMCR, 0);
-	if (ret < 0)
-		return ret;
-
-	return genphy_soft_reset(phydev);
-}
-
-static struct phy_driver asix_driver[] = { {
-	.phy_id		= PHY_ID_ASIX_AX88796B,
-	.name		= "Asix Electronics AX88796B",
-	.phy_id_mask	= 0xfffffff0,
-	/* PHY_BASIC_FEATURES */
-	.soft_reset	= asix_soft_reset,
-} };
-
-module_phy_driver(asix_driver);
-
-static struct mdio_device_id __maybe_unused asix_tbl[] = {
-	{ PHY_ID_ASIX_AX88796B, 0xfffffff0 },
-	{ }
-};
-
-MODULE_DEVICE_TABLE(mdio, asix_tbl);
diff --git a/drivers/net/phy/ax88796b.c b/drivers/net/phy/ax88796b.c
new file mode 100644
index 0000000..79bf7ef
--- /dev/null
+++ b/drivers/net/phy/ax88796b.c
@@ -0,0 +1,57 @@
+// SPDX-License-Identifier: GPL-2.0+
+/* Driver for Asix PHYs
+ *
+ * Author: Michael Schmitz <schmitzmic@gmail.com>
+ */
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/mii.h>
+#include <linux/phy.h>
+
+#define PHY_ID_ASIX_AX88796B		0x003b1841
+
+MODULE_DESCRIPTION("Asix PHY driver");
+MODULE_AUTHOR("Michael Schmitz <schmitzmic@gmail.com>");
+MODULE_LICENSE("GPL");
+
+/**
+ * asix_soft_reset - software reset the PHY via BMCR_RESET bit
+ * @phydev: target phy_device struct
+ *
+ * Description: Perform a software PHY reset using the standard
+ * BMCR_RESET bit and poll for the reset bit to be cleared.
+ * Toggle BMCR_RESET bit off to accommodate broken AX8796B PHY implementation
+ * such as used on the Individual Computers' X-Surf 100 Zorro card.
+ *
+ * Returns: 0 on success, < 0 on failure
+ */
+static int asix_soft_reset(struct phy_device *phydev)
+{
+	int ret;
+
+	/* Asix PHY won't reset unless reset bit toggles */
+	ret = phy_write(phydev, MII_BMCR, 0);
+	if (ret < 0)
+		return ret;
+
+	return genphy_soft_reset(phydev);
+}
+
+static struct phy_driver asix_driver[] = { {
+	.phy_id		= PHY_ID_ASIX_AX88796B,
+	.name		= "Asix Electronics AX88796B",
+	.phy_id_mask	= 0xfffffff0,
+	/* PHY_BASIC_FEATURES */
+	.soft_reset	= asix_soft_reset,
+} };
+
+module_phy_driver(asix_driver);
+
+static struct mdio_device_id __maybe_unused asix_tbl[] = {
+	{ PHY_ID_ASIX_AX88796B, 0xfffffff0 },
+	{ }
+};
+
+MODULE_DEVICE_TABLE(mdio, asix_tbl);
-- 
1.9.1


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

* Re: [PATCH 0/3] resolve module name conflict for asix PHY and USB modules
  2019-05-17 21:20       ` Andrew Lunn
@ 2019-05-18  1:17         ` Michael Schmitz
  0 siblings, 0 replies; 22+ messages in thread
From: Michael Schmitz @ 2019-05-18  1:17 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, sfr, davem

Thanks Andrew,

makes perfect sense - patch resent.

Cheers,

	Michael

Am 18.05.2019 um 09:20 schrieb Andrew Lunn:
> On Sat, May 18, 2019 at 08:25:15AM +1200, Michael Schmitz wrote:
>> Haven't heard back in a while, so here goes:
>>
>> Commit 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
>> introduced a new PHY driver drivers/net/phy/asix.c that causes a module
>> name conflict with a pre-existiting driver (drivers/net/usb/asix.c).
>>
>> The PHY driver is used by the X-Surf 100 ethernet card driver, and loaded
>> by that driver via its PHY ID. A rename of the driver looks unproblematic.
>>
>> Rename PHY driver to ax88796b.c in order to resolve name conflict.
>
> Hi Michael
>
> Please just use git mv and do it all one patch. It then makes it clear
> you have not changed the driver, just renamed it.
>
> Thanks
> 	Andrew
>

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

* Re: [PATCH v2] net: phy: rename Asix Electronics PHY driver
  2019-05-18  1:14     ` [PATCH v2] net: phy: rename " Michael Schmitz
@ 2019-05-18 14:20       ` Andrew Lunn
  2019-05-18 17:48         ` Michael Schmitz
  0 siblings, 1 reply; 22+ messages in thread
From: Andrew Lunn @ 2019-05-18 14:20 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: netdev, netdev, schmitz, davem, sfr

On Sat, May 18, 2019 at 01:14:55PM +1200, Michael Schmitz wrote:
> Commit 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
> introduced a new PHY driver drivers/net/phy/asix.c that causes a module
> name conflict with a pre-existiting driver (drivers/net/usb/asix.c).
> 
> The PHY driver is used by the X-Surf 100 ethernet card driver, and loaded
> by that driver via its PHY ID. A rename of the driver looks unproblematic.
> 
> Rename PHY driver to ax88796b.c in order to resolve name conflict.
> 
> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
> Fixes: 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
> ---
> 
> Changes from v1:
> 
> - merge into single commit (suggested by Andrew Lunn)

Hi Michael

There is a flag you can pass to git which will make it issue a rename,
rather than delete and then add. That will make the patch much
smaller.

net-next is closed at the moment.

http://vger.kernel.org/~davem/net-next.html

Once it reopens, please send a v3, and it will be merged.

Thanks
	Andrew

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

* Re: [PATCH v2] net: phy: rename Asix Electronics PHY driver
  2019-05-18 14:20       ` Andrew Lunn
@ 2019-05-18 17:48         ` Michael Schmitz
  2019-05-18 18:04           ` Andrew Lunn
  0 siblings, 1 reply; 22+ messages in thread
From: Michael Schmitz @ 2019-05-18 17:48 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, davem, sfr

Hi Andrew,

Am 19.05.2019 um 02:20 schrieb Andrew Lunn:
> On Sat, May 18, 2019 at 01:14:55PM +1200, Michael Schmitz wrote:
>> Commit 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
>> introduced a new PHY driver drivers/net/phy/asix.c that causes a module
>> name conflict with a pre-existiting driver (drivers/net/usb/asix.c).
>>
>> The PHY driver is used by the X-Surf 100 ethernet card driver, and loaded
>> by that driver via its PHY ID. A rename of the driver looks unproblematic.
>>
>> Rename PHY driver to ax88796b.c in order to resolve name conflict.
>>
>> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
>> Fixes: 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
>> ---
>>
>> Changes from v1:
>>
>> - merge into single commit (suggested by Andrew Lunn)
>
> Hi Michael
>
> There is a flag you can pass to git which will make it issue a rename,
> rather than delete and then add. That will make the patch much
> smaller.

Thanks, will do.

> net-next is closed at the moment.

My apologies - I had hoped that as a bugfix. this could go straight to net.

Cheers,

	Michael

>
> http://vger.kernel.org/~davem/net-next.html
>
> Once it reopens, please send a v3, and it will be merged.
>
> Thanks
> 	Andrew
>

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

* Re: [PATCH v2] net: phy: rename Asix Electronics PHY driver
  2019-05-18 17:48         ` Michael Schmitz
@ 2019-05-18 18:04           ` Andrew Lunn
  0 siblings, 0 replies; 22+ messages in thread
From: Andrew Lunn @ 2019-05-18 18:04 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: netdev, davem, sfr

> My apologies - I had hoped that as a bugfix. this could go straight to net.

Ah, O.K. You then need to put "PATCH net" to make it clear this is for
net.

	Andrew

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

* [PATCH net v3] net: phy: rename Asix Electronics PHY driver
  2019-05-14  0:56   ` Stephen Rothwell
                       ` (5 preceding siblings ...)
  2019-05-18  1:14     ` [PATCH v2] net: phy: rename " Michael Schmitz
@ 2019-06-07  5:37     ` Michael Schmitz
  2019-06-07 13:00       ` Andrew Lunn
  2019-06-09 20:24       ` David Miller
  6 siblings, 2 replies; 22+ messages in thread
From: Michael Schmitz @ 2019-06-07  5:37 UTC (permalink / raw)
  To: netdev, netdev; +Cc: anders.roxell, Michael Schmitz, andrew, davem, sfr

[Resent to net instead of net-next - may clash with Anders Roxell's patch
series addressing duplicate module names]

Commit 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
introduced a new PHY driver drivers/net/phy/asix.c that causes a module
name conflict with a pre-existiting driver (drivers/net/usb/asix.c).

The PHY driver is used by the X-Surf 100 ethernet card driver, and loaded
by that driver via its PHY ID. A rename of the driver looks unproblematic.

Rename PHY driver to ax88796b.c in order to resolve name conflict. 

Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Fixes: 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
---

Changes from v1:

- merge into single commit (suggested by Andrew Lunn)

Changes from v2:

- use rename flag for diff (suggested by Andrew Lunn)
---
 drivers/net/ethernet/8390/Kconfig      | 2 +-
 drivers/net/phy/Kconfig                | 2 +-
 drivers/net/phy/Makefile               | 2 +-
 drivers/net/phy/{asix.c => ax88796b.c} | 0
 4 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/8390/Kconfig b/drivers/net/ethernet/8390/Kconfig
index f2f0264..443b34e 100644
--- a/drivers/net/ethernet/8390/Kconfig
+++ b/drivers/net/ethernet/8390/Kconfig
@@ -49,7 +49,7 @@ config XSURF100
 	tristate "Amiga XSurf 100 AX88796/NE2000 clone support"
 	depends on ZORRO
 	select AX88796
-	select ASIX_PHY
+	select AX88796B_PHY
 	help
 	  This driver is for the Individual Computers X-Surf 100 Ethernet
 	  card (based on the Asix AX88796 chip). If you have such a card,
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index d629971..5496e5c 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -253,7 +253,7 @@ config AQUANTIA_PHY
 	---help---
 	  Currently supports the Aquantia AQ1202, AQ2104, AQR105, AQR405
 
-config ASIX_PHY
+config AX88796B_PHY
 	tristate "Asix PHYs"
 	help
 	  Currently supports the Asix Electronics PHY found in the X-Surf 100
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index 27d7f9f..5b5c866 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -52,7 +52,7 @@ ifdef CONFIG_HWMON
 aquantia-objs			+= aquantia_hwmon.o
 endif
 obj-$(CONFIG_AQUANTIA_PHY)	+= aquantia.o
-obj-$(CONFIG_ASIX_PHY)		+= asix.o
+obj-$(CONFIG_AX88796B_PHY)	+= ax88796b.o
 obj-$(CONFIG_AT803X_PHY)	+= at803x.o
 obj-$(CONFIG_BCM63XX_PHY)	+= bcm63xx.o
 obj-$(CONFIG_BCM7XXX_PHY)	+= bcm7xxx.o
diff --git a/drivers/net/phy/asix.c b/drivers/net/phy/ax88796b.c
similarity index 100%
rename from drivers/net/phy/asix.c
rename to drivers/net/phy/ax88796b.c
-- 
1.9.1


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

* Re: [PATCH net v3] net: phy: rename Asix Electronics PHY driver
  2019-06-07  5:37     ` [PATCH net v3] " Michael Schmitz
@ 2019-06-07 13:00       ` Andrew Lunn
  2019-06-08  1:54         ` Michael Schmitz
  2019-06-09 20:24       ` David Miller
  1 sibling, 1 reply; 22+ messages in thread
From: Andrew Lunn @ 2019-06-07 13:00 UTC (permalink / raw)
  To: Michael Schmitz; +Cc: netdev, netdev, anders.roxell, davem, sfr

On Fri, Jun 07, 2019 at 05:37:34PM +1200, Michael Schmitz wrote:
> [Resent to net instead of net-next - may clash with Anders Roxell's patch
> series addressing duplicate module names]
> 
> Commit 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
> introduced a new PHY driver drivers/net/phy/asix.c that causes a module
> name conflict with a pre-existiting driver (drivers/net/usb/asix.c).
> 
> The PHY driver is used by the X-Surf 100 ethernet card driver, and loaded
> by that driver via its PHY ID. A rename of the driver looks unproblematic.
> 
> Rename PHY driver to ax88796b.c in order to resolve name conflict. 
> 
> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
> Tested-by: Michael Schmitz <schmitzmic@gmail.com>
> Fixes: 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH net v3] net: phy: rename Asix Electronics PHY driver
  2019-06-07 13:00       ` Andrew Lunn
@ 2019-06-08  1:54         ` Michael Schmitz
  0 siblings, 0 replies; 22+ messages in thread
From: Michael Schmitz @ 2019-06-08  1:54 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, davem, Geert Uytterhoeven



Am 08.06.2019 um 01:00 schrieb Andrew Lunn:
> On Fri, Jun 07, 2019 at 05:37:34PM +1200, Michael Schmitz wrote:
>> [Resent to net instead of net-next - may clash with Anders Roxell's patch
>> series addressing duplicate module names]
>>
>> Commit 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
>> introduced a new PHY driver drivers/net/phy/asix.c that causes a module
>> name conflict with a pre-existiting driver (drivers/net/usb/asix.c).
>>
>> The PHY driver is used by the X-Surf 100 ethernet card driver, and loaded
>> by that driver via its PHY ID. A rename of the driver looks unproblematic.
>>
>> Rename PHY driver to ax88796b.c in order to resolve name conflict.
>>
>> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
>> Tested-by: Michael Schmitz <schmitzmic@gmail.com>
>> Fixes: 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Thanks for your review, Andrew.

Which reminds me - I had submitted two patches as cleanup for the 
xsurf100.c driver that would allow us to drop including lib8390.c there. 
The patches were reviewed by Geert but never picked up by Dave.

The card-specific block_output function provided by the xsurf100.c 
driver needs to execute reset_8380() when transfers get stuffed up. 
According to the comment at the head of lib8390.c, a reset must always 
be followed by a call to __NS8390_init(), so this function is also 
needed by our block_output. The current xsurf100.c includes lib8390.c 
just for the benefit of that single function.

My solution was to export ax_8390_init() through a public wrapper, but 
that didn't find favour, apparently. The only other solution I can see 
would be to add an init_8380 function pointer to the ei_device struct, 
but as init_8390 isn't really board specific, that would be abusing 
ei_device a little, no?

Any feedback welcome.

Cheers,

	Michael


>
>     Andrew
>

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

* Re: [PATCH net v3] net: phy: rename Asix Electronics PHY driver
  2019-06-07  5:37     ` [PATCH net v3] " Michael Schmitz
  2019-06-07 13:00       ` Andrew Lunn
@ 2019-06-09 20:24       ` David Miller
  1 sibling, 0 replies; 22+ messages in thread
From: David Miller @ 2019-06-09 20:24 UTC (permalink / raw)
  To: schmitzmic; +Cc: netdev, netdev, anders.roxell, andrew, sfr

From: Michael Schmitz <schmitzmic@gmail.com>
Date: Fri,  7 Jun 2019 17:37:34 +1200

> [Resent to net instead of net-next - may clash with Anders Roxell's patch
> series addressing duplicate module names]
> 
> Commit 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
> introduced a new PHY driver drivers/net/phy/asix.c that causes a module
> name conflict with a pre-existiting driver (drivers/net/usb/asix.c).
> 
> The PHY driver is used by the X-Surf 100 ethernet card driver, and loaded
> by that driver via its PHY ID. A rename of the driver looks unproblematic.
> 
> Rename PHY driver to ax88796b.c in order to resolve name conflict. 
> 
> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
> Tested-by: Michael Schmitz <schmitzmic@gmail.com>
> Fixes: 31dd83b96641 ("net-next: phy: new Asix Electronics PHY driver")
> ---
> 
> Changes from v1:
> 
> - merge into single commit (suggested by Andrew Lunn)
> 
> Changes from v2:
> 
> - use rename flag for diff (suggested by Andrew Lunn)

Applied, thanks.

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

end of thread, other threads:[~2019-06-09 20:24 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-14  0:15 linux-next: build failure after merge of the ecryptfs tree Stephen Rothwell
2019-05-14  0:40 ` Masahiro Yamada
2019-05-14  0:56   ` Stephen Rothwell
2019-05-14  1:22     ` Michael Schmitz
2019-05-15  4:28       ` Michael Schmitz
2019-05-17 20:25     ` [PATCH 0/3] resolve module name conflict for asix PHY and USB modules Michael Schmitz
2019-05-17 21:20       ` Andrew Lunn
2019-05-18  1:17         ` Michael Schmitz
2019-05-17 20:25     ` [PATCH 1/3] net: phy: new ax88796b.c Asix Electronics PHY driver Michael Schmitz
2019-05-17 20:25     ` [PATCH 2/3] net: 8390: switch X-Surf 100 driver to use ax88796b PHY Michael Schmitz
2019-05-17 20:25     ` [PATCH 3/3] net: phy: remove old Asix Electronics PHY driver Michael Schmitz
2019-05-18  1:14     ` [PATCH v2] net: phy: rename " Michael Schmitz
2019-05-18 14:20       ` Andrew Lunn
2019-05-18 17:48         ` Michael Schmitz
2019-05-18 18:04           ` Andrew Lunn
2019-06-07  5:37     ` [PATCH net v3] " Michael Schmitz
2019-06-07 13:00       ` Andrew Lunn
2019-06-08  1:54         ` Michael Schmitz
2019-06-09 20:24       ` David Miller
2019-05-14  1:03   ` linux-next: build failure after merge of the ecryptfs tree Stephen Rothwell
2019-05-14  4:16     ` Masahiro Yamada
2019-05-14  4:49       ` Stephen Rothwell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.