* [PATCH net v2] mod_devicetable: fix PHY module format
@ 2019-12-19 23:24 Russell King
2019-12-20 3:57 ` Florian Fainelli
2019-12-21 5:47 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Russell King @ 2019-12-19 23:24 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Heiner Kallweit
Cc: David S. Miller, netdev, Andy Fleming, David Woodhouse,
Ben Hutchings
When a PHY is probed, if the top bit is set, we end up requesting a
module with the string "mdio:-10101110000000100101000101010001" -
the top bit is printed to a signed -1 value. This leads to the module
not being loaded.
Fix the module format string and the macro generating the values for
it to ensure that we only print unsigned types and the top bit is
always 0/1. We correctly end up with
"mdio:10101110000000100101000101010001".
Fixes: 8626d3b43280 ("phylib: Support phy module autoloading")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
include/linux/mod_devicetable.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 5714fd35a83c..e3596db077dc 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -587,9 +587,9 @@ struct platform_device_id {
#define MDIO_NAME_SIZE 32
#define MDIO_MODULE_PREFIX "mdio:"
-#define MDIO_ID_FMT "%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d"
+#define MDIO_ID_FMT "%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u%u"
#define MDIO_ID_ARGS(_id) \
- (_id)>>31, ((_id)>>30) & 1, ((_id)>>29) & 1, ((_id)>>28) & 1, \
+ ((_id)>>31) & 1, ((_id)>>30) & 1, ((_id)>>29) & 1, ((_id)>>28) & 1, \
((_id)>>27) & 1, ((_id)>>26) & 1, ((_id)>>25) & 1, ((_id)>>24) & 1, \
((_id)>>23) & 1, ((_id)>>22) & 1, ((_id)>>21) & 1, ((_id)>>20) & 1, \
((_id)>>19) & 1, ((_id)>>18) & 1, ((_id)>>17) & 1, ((_id)>>16) & 1, \
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] mod_devicetable: fix PHY module format
2019-12-19 23:24 [PATCH net v2] mod_devicetable: fix PHY module format Russell King
@ 2019-12-20 3:57 ` Florian Fainelli
2019-12-21 5:47 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2019-12-20 3:57 UTC (permalink / raw)
To: Russell King, Andrew Lunn, Heiner Kallweit
Cc: David S. Miller, netdev, Andy Fleming, David Woodhouse,
Ben Hutchings
On 12/19/2019 3:24 PM, Russell King wrote:
> When a PHY is probed, if the top bit is set, we end up requesting a
> module with the string "mdio:-10101110000000100101000101010001" -
> the top bit is printed to a signed -1 value. This leads to the module
> not being loaded.
>
> Fix the module format string and the macro generating the values for
> it to ensure that we only print unsigned types and the top bit is
> always 0/1. We correctly end up with
> "mdio:10101110000000100101000101010001".
>
> Fixes: 8626d3b43280 ("phylib: Support phy module autoloading")
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] mod_devicetable: fix PHY module format
2019-12-19 23:24 [PATCH net v2] mod_devicetable: fix PHY module format Russell King
2019-12-20 3:57 ` Florian Fainelli
@ 2019-12-21 5:47 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-12-21 5:47 UTC (permalink / raw)
To: rmk+kernel; +Cc: andrew, f.fainelli, hkallweit1, netdev, afleming, dwmw2, ben
From: Russell King <rmk+kernel@armlinux.org.uk>
Date: Thu, 19 Dec 2019 23:24:47 +0000
> When a PHY is probed, if the top bit is set, we end up requesting a
> module with the string "mdio:-10101110000000100101000101010001" -
> the top bit is printed to a signed -1 value. This leads to the module
> not being loaded.
>
> Fix the module format string and the macro generating the values for
> it to ensure that we only print unsigned types and the top bit is
> always 0/1. We correctly end up with
> "mdio:10101110000000100101000101010001".
>
> Fixes: 8626d3b43280 ("phylib: Support phy module autoloading")
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Applied and queued up for -stable.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-12-21 5:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-19 23:24 [PATCH net v2] mod_devicetable: fix PHY module format Russell King
2019-12-20 3:57 ` Florian Fainelli
2019-12-21 5:47 ` David Miller
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).