From: Peter Geis <hidden> Date: 2021-05-11 21:46:41
Add a driver for the Motorcomm yt8511 phy that will be used in the
production Pine64 rk3566-quartz64 development board.
It supports gigabit transfer speeds, rgmii, and 125mhz clk output.
Signed-off-by: Peter Geis <redacted>
---
MAINTAINERS | 6 +++
drivers/net/phy/Kconfig | 6 +++
drivers/net/phy/Makefile | 1 +
drivers/net/phy/motorcomm.c | 85 +++++++++++++++++++++++++++++++++++++
4 files changed, 98 insertions(+)
create mode 100644 drivers/net/phy/motorcomm.c
Please drop the '&' here, it's unnecessary.
Thanks.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
From: Leon Romanovsky <leon@kernel.org> Date: 2021-05-18 09:00:19
On Tue, May 11, 2021 at 05:46:06PM -0400, Peter Geis wrote:
Add a driver for the Motorcomm yt8511 phy that will be used in the
production Pine64 rk3566-quartz64 development board.
It supports gigabit transfer speeds, rgmii, and 125mhz clk output.
Signed-off-by: Peter Geis <redacted>
---
MAINTAINERS | 6 +++
drivers/net/phy/Kconfig | 6 +++
drivers/net/phy/Makefile | 1 +
drivers/net/phy/motorcomm.c | 85 +++++++++++++++++++++++++++++++++++++
4 files changed, 98 insertions(+)
create mode 100644 drivers/net/phy/motorcomm.c
Why is this "__maybe_unused"? This *.c file doesn't have any compilation option
to compile part of it.
The "__maybe_unused" is not needed in this case.
Thanks
From: Peter Geis <hidden> Date: 2021-05-19 00:20:22
On Tue, May 18, 2021 at 4:59 AM Leon Romanovsky [off-list ref] wrote:
On Tue, May 11, 2021 at 05:46:06PM -0400, Peter Geis wrote:
quoted
Add a driver for the Motorcomm yt8511 phy that will be used in the
production Pine64 rk3566-quartz64 development board.
It supports gigabit transfer speeds, rgmii, and 125mhz clk output.
Signed-off-by: Peter Geis <redacted>
---
MAINTAINERS | 6 +++
drivers/net/phy/Kconfig | 6 +++
drivers/net/phy/Makefile | 1 +
drivers/net/phy/motorcomm.c | 85 +++++++++++++++++++++++++++++++++++++
4 files changed, 98 insertions(+)
create mode 100644 drivers/net/phy/motorcomm.c
Why is this "__maybe_unused"? This *.c file doesn't have any compilation option
to compile part of it.
The "__maybe_unused" is not needed in this case.
I was simply following convention, for example the realtek.c,
micrel.c, and smsc.c drivers all have this as well.
From: Leon Romanovsky <leon@kernel.org> Date: 2021-05-19 08:18:26
On Tue, May 18, 2021 at 08:20:03PM -0400, Peter Geis wrote:
On Tue, May 18, 2021 at 4:59 AM Leon Romanovsky [off-list ref] wrote:
quoted
On Tue, May 11, 2021 at 05:46:06PM -0400, Peter Geis wrote:
quoted
Add a driver for the Motorcomm yt8511 phy that will be used in the
production Pine64 rk3566-quartz64 development board.
It supports gigabit transfer speeds, rgmii, and 125mhz clk output.
Signed-off-by: Peter Geis <redacted>
---
MAINTAINERS | 6 +++
drivers/net/phy/Kconfig | 6 +++
drivers/net/phy/Makefile | 1 +
drivers/net/phy/motorcomm.c | 85 +++++++++++++++++++++++++++++++++++++
4 files changed, 98 insertions(+)
create mode 100644 drivers/net/phy/motorcomm.c
Why is this "__maybe_unused"? This *.c file doesn't have any compilation option
to compile part of it.
The "__maybe_unused" is not needed in this case.
I was simply following convention, for example the realtek.c,
micrel.c, and smsc.c drivers all have this as well.
Maybe they have a reason, but this specific driver doesn't have such.
Thanks
On Tue, May 18, 2021 at 08:20:03PM -0400, Peter Geis wrote:
quoted
On Tue, May 18, 2021 at 4:59 AM Leon Romanovsky [off-list ref] wrote:
quoted
On Tue, May 11, 2021 at 05:46:06PM -0400, Peter Geis wrote:
quoted
Add a driver for the Motorcomm yt8511 phy that will be used in the
production Pine64 rk3566-quartz64 development board.
It supports gigabit transfer speeds, rgmii, and 125mhz clk output.
Signed-off-by: Peter Geis <redacted>
---
MAINTAINERS | 6 +++
drivers/net/phy/Kconfig | 6 +++
drivers/net/phy/Makefile | 1 +
drivers/net/phy/motorcomm.c | 85 +++++++++++++++++++++++++++++++++++++
4 files changed, 98 insertions(+)
create mode 100644 drivers/net/phy/motorcomm.c
Why is this "__maybe_unused"? This *.c file doesn't have any compilation option
to compile part of it.
The "__maybe_unused" is not needed in this case.
I was simply following convention, for example the realtek.c,
micrel.c, and smsc.c drivers all have this as well.
Maybe they have a reason, but this specific driver doesn't have such.
It's used like this:
MODULE_DEVICE_TABLE(mdio, <mdio_device_id_tbl>);
And MODULE_DEVICE_TABLE is a no-op if MODULE isn't defined:
#ifdef MODULE
/* Creates an alias so file2alias.c can find device table. */
#define MODULE_DEVICE_TABLE(type, name) \
extern typeof(name) __mod_##type##__##name##_device_table \
__attribute__ ((unused, alias(__stringify(name))))
#else /* !MODULE */
#define MODULE_DEVICE_TABLE(type, name)
#endif
In this case the table is unused.
From: Leon Romanovsky <leon@kernel.org> Date: 2021-05-19 11:50:16
On Wed, May 19, 2021 at 12:37:43PM +0200, Heiner Kallweit wrote:
On 19.05.2021 10:18, Leon Romanovsky wrote:
quoted
On Tue, May 18, 2021 at 08:20:03PM -0400, Peter Geis wrote:
quoted
On Tue, May 18, 2021 at 4:59 AM Leon Romanovsky [off-list ref] wrote:
quoted
On Tue, May 11, 2021 at 05:46:06PM -0400, Peter Geis wrote:
quoted
Add a driver for the Motorcomm yt8511 phy that will be used in the
production Pine64 rk3566-quartz64 development board.
It supports gigabit transfer speeds, rgmii, and 125mhz clk output.
Signed-off-by: Peter Geis <redacted>
---
MAINTAINERS | 6 +++
drivers/net/phy/Kconfig | 6 +++
drivers/net/phy/Makefile | 1 +
drivers/net/phy/motorcomm.c | 85 +++++++++++++++++++++++++++++++++++++
4 files changed, 98 insertions(+)
create mode 100644 drivers/net/phy/motorcomm.c
Why is this "__maybe_unused"? This *.c file doesn't have any compilation option
to compile part of it.
The "__maybe_unused" is not needed in this case.
I was simply following convention, for example the realtek.c,
micrel.c, and smsc.c drivers all have this as well.
Maybe they have a reason, but this specific driver doesn't have such.
It's used like this:
MODULE_DEVICE_TABLE(mdio, <mdio_device_id_tbl>);
And MODULE_DEVICE_TABLE is a no-op if MODULE isn't defined:
#ifdef MODULE
/* Creates an alias so file2alias.c can find device table. */
#define MODULE_DEVICE_TABLE(type, name) \
extern typeof(name) __mod_##type##__##name##_device_table \
__attribute__ ((unused, alias(__stringify(name))))
#else /* !MODULE */
#define MODULE_DEVICE_TABLE(type, name)
#endif
In this case the table is unused.
Do you see compilation warning for such scenario?
Thanks
From: Peter Geis <hidden> Date: 2021-05-19 12:45:36
On Wed, May 19, 2021 at 7:50 AM Leon Romanovsky [off-list ref] wrote:
On Wed, May 19, 2021 at 12:37:43PM +0200, Heiner Kallweit wrote:
quoted
On 19.05.2021 10:18, Leon Romanovsky wrote:
quoted
On Tue, May 18, 2021 at 08:20:03PM -0400, Peter Geis wrote:
quoted
On Tue, May 18, 2021 at 4:59 AM Leon Romanovsky [off-list ref] wrote:
quoted
On Tue, May 11, 2021 at 05:46:06PM -0400, Peter Geis wrote:
quoted
Add a driver for the Motorcomm yt8511 phy that will be used in the
production Pine64 rk3566-quartz64 development board.
It supports gigabit transfer speeds, rgmii, and 125mhz clk output.
Signed-off-by: Peter Geis <redacted>
---
MAINTAINERS | 6 +++
drivers/net/phy/Kconfig | 6 +++
drivers/net/phy/Makefile | 1 +
drivers/net/phy/motorcomm.c | 85 +++++++++++++++++++++++++++++++++++++
4 files changed, 98 insertions(+)
create mode 100644 drivers/net/phy/motorcomm.c
Why is this "__maybe_unused"? This *.c file doesn't have any compilation option
to compile part of it.
The "__maybe_unused" is not needed in this case.
I was simply following convention, for example the realtek.c,
micrel.c, and smsc.c drivers all have this as well.
Maybe they have a reason, but this specific driver doesn't have such.
It's used like this:
MODULE_DEVICE_TABLE(mdio, <mdio_device_id_tbl>);
And MODULE_DEVICE_TABLE is a no-op if MODULE isn't defined:
#ifdef MODULE
/* Creates an alias so file2alias.c can find device table. */
#define MODULE_DEVICE_TABLE(type, name) \
extern typeof(name) __mod_##type##__##name##_device_table \
__attribute__ ((unused, alias(__stringify(name))))
#else /* !MODULE */
#define MODULE_DEVICE_TABLE(type, name)
#endif
In this case the table is unused.
Do you see compilation warning for such scenario?
The issue you are describing has been fixed since 2010:
commit cf93c94581bab447a5634c6d737c1cf38c080261
Author: Uwe Kleine-König [off-list ref]
Date: Sun Oct 3 23:43:32 2010 +0000
net/phy: fix many "defined but unused" warnings
MODULE_DEVICE_TABLE only expands to something if it's compiled
for a module. So when building-in support for the phys, the
mdio_device_id tables are unused. Marking them with __maybe_unused
fixes the following warnings:
There is a strong push to fix all warnings during build, including W=1 warnings.
For fun I rebuilt without module support and confirmed that removing
this does trigger a W=1 warning.
From: Leon Romanovsky <leon@kernel.org> Date: 2021-05-19 12:56:27
On Wed, May 19, 2021 at 08:45:21AM -0400, Peter Geis wrote:
On Wed, May 19, 2021 at 7:50 AM Leon Romanovsky [off-list ref] wrote:
quoted
On Wed, May 19, 2021 at 12:37:43PM +0200, Heiner Kallweit wrote:
quoted
On 19.05.2021 10:18, Leon Romanovsky wrote:
quoted
On Tue, May 18, 2021 at 08:20:03PM -0400, Peter Geis wrote:
quoted
On Tue, May 18, 2021 at 4:59 AM Leon Romanovsky [off-list ref] wrote:
quoted
On Tue, May 11, 2021 at 05:46:06PM -0400, Peter Geis wrote:
quoted
Add a driver for the Motorcomm yt8511 phy that will be used in the
production Pine64 rk3566-quartz64 development board.
It supports gigabit transfer speeds, rgmii, and 125mhz clk output.
Signed-off-by: Peter Geis <redacted>
---
MAINTAINERS | 6 +++
drivers/net/phy/Kconfig | 6 +++
drivers/net/phy/Makefile | 1 +
drivers/net/phy/motorcomm.c | 85 +++++++++++++++++++++++++++++++++++++
4 files changed, 98 insertions(+)
create mode 100644 drivers/net/phy/motorcomm.c
Why is this "__maybe_unused"? This *.c file doesn't have any compilation option
to compile part of it.
The "__maybe_unused" is not needed in this case.
I was simply following convention, for example the realtek.c,
micrel.c, and smsc.c drivers all have this as well.
Maybe they have a reason, but this specific driver doesn't have such.
It's used like this:
MODULE_DEVICE_TABLE(mdio, <mdio_device_id_tbl>);
And MODULE_DEVICE_TABLE is a no-op if MODULE isn't defined:
#ifdef MODULE
/* Creates an alias so file2alias.c can find device table. */
#define MODULE_DEVICE_TABLE(type, name) \
extern typeof(name) __mod_##type##__##name##_device_table \
__attribute__ ((unused, alias(__stringify(name))))
#else /* !MODULE */
#define MODULE_DEVICE_TABLE(type, name)
#endif
In this case the table is unused.
Do you see compilation warning for such scenario?
The issue you are describing has been fixed since 2010:
commit cf93c94581bab447a5634c6d737c1cf38c080261
Author: Uwe Kleine-König [off-list ref]
Date: Sun Oct 3 23:43:32 2010 +0000
net/phy: fix many "defined but unused" warnings
MODULE_DEVICE_TABLE only expands to something if it's compiled
for a module. So when building-in support for the phys, the
mdio_device_id tables are unused. Marking them with __maybe_unused
fixes the following warnings:
There is a strong push to fix all warnings during build, including W=1 warnings.
For fun I rebuilt without module support and confirmed that removing
this does trigger a W=1 warning.
I'm sorry that I continue to ask, but is net/phy/* usable without MODULE?
If not, the better fix is to require it in Kconfig instead of fixing all drivers.
Thanks for your answers.
From: Peter Geis <hidden> Date: 2021-05-19 13:25:29
On Wed, May 19, 2021 at 9:15 AM Russell King (Oracle)
[off-list ref] wrote:
On Wed, May 19, 2021 at 03:56:18PM +0300, Leon Romanovsky wrote:
quoted
I'm sorry that I continue to ask, but is net/phy/* usable without MODULE?
Simple answer: it is.
As far as I can tell, so correct me if I'm wrong, MODULE_DEVICE_TABLE
is what permits the module system to automatically load the correct
module for the device.