* [PATCH 1/3] dt-bindings: net: add PHY reset controller binding
@ 2019-04-15 12:38 David Bauer
2019-04-15 12:38 ` [PATCH 2/3] net: phy: add support for reset-controller David Bauer
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: David Bauer @ 2019-04-15 12:38 UTC (permalink / raw)
To: devicetree, netdev
Add the documentation for PHY reset lines controlled by a reset controller.
Signed-off-by: David Bauer <mail@david-bauer.net>
---
Documentation/devicetree/bindings/net/phy.txt | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/phy.txt b/Documentation/devicetree/bindings/net/phy.txt
index 17c1d2bd00f6..9b9e5b1765dd 100644
--- a/Documentation/devicetree/bindings/net/phy.txt
+++ b/Documentation/devicetree/bindings/net/phy.txt
@@ -51,6 +51,10 @@ Optional Properties:
to ensure the integrated PHY is used. The absence of this property indicates
the muxers should be configured so that the external PHY is used.
+- resets: The reset-controller phandle and specifier for the PHY reset signal.
+
+- reset-names: Must be "phy" for the PHY reset signal.
+
- reset-gpios: The GPIO phandle and specifier for the PHY reset signal.
- reset-assert-us: Delay after the reset was asserted in microseconds.
@@ -67,6 +71,8 @@ ethernet-phy@0 {
interrupts = <35 IRQ_TYPE_EDGE_RISING>;
reg = <0>;
+ resets = <&rst 8>;
+ reset-names = "phy";
reset-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
reset-assert-us = <1000>;
reset-deassert-us = <2000>;
--
2.21.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/3] net: phy: add support for reset-controller
2019-04-15 12:38 [PATCH 1/3] dt-bindings: net: add PHY reset controller binding David Bauer
@ 2019-04-15 12:38 ` David Bauer
2019-04-15 17:01 ` Andrew Lunn
2019-04-15 12:38 ` [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio David Bauer
2019-04-15 17:04 ` [PATCH 1/3] dt-bindings: net: add PHY reset controller binding Andrew Lunn
2 siblings, 1 reply; 9+ messages in thread
From: David Bauer @ 2019-04-15 12:38 UTC (permalink / raw)
To: devicetree, netdev
This commit adds support for PHY reset pins handled by a reset controller.
Signed-off-by: David Bauer <mail@david-bauer.net>
---
drivers/net/phy/mdio_bus.c | 25 +++++++++++++++++++++++++
drivers/net/phy/mdio_device.c | 13 +++++++++++--
include/linux/mdio.h | 1 +
3 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 4be4cc09eb90..7590645f19ef 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -24,6 +24,7 @@
#include <linux/of_gpio.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
+#include <linux/reset.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/mm.h>
@@ -63,6 +64,27 @@ static int mdiobus_register_gpiod(struct mdio_device *mdiodev)
return 0;
}
+static int mdiobus_register_reset(struct mdio_device *mdiodev)
+{
+ struct reset_control *reset = NULL;
+
+ if (mdiodev->dev.of_node)
+ reset = devm_reset_control_get_exclusive(&mdiodev->dev,
+ "phy");
+ if (PTR_ERR(reset) == -ENOENT ||
+ PTR_ERR(reset) == -ENOTSUPP)
+ reset = NULL;
+ else if (IS_ERR(reset))
+ return PTR_ERR(reset);
+
+ mdiodev->reset_ctrl = reset;
+
+ /* Assert the reset signal */
+ mdio_device_reset(mdiodev, 1);
+
+ return 0;
+}
+
int mdiobus_register_device(struct mdio_device *mdiodev)
{
int err;
@@ -74,6 +96,9 @@ int mdiobus_register_device(struct mdio_device *mdiodev)
err = mdiobus_register_gpiod(mdiodev);
if (err)
return err;
+ err = mdiobus_register_reset(mdiodev);
+ if (err)
+ return err;
}
mdiodev->bus->mdio_map[mdiodev->addr] = mdiodev;
diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c
index 887076292e50..57668e0f9256 100644
--- a/drivers/net/phy/mdio_device.c
+++ b/drivers/net/phy/mdio_device.c
@@ -16,6 +16,7 @@
#include <linux/mii.h>
#include <linux/module.h>
#include <linux/phy.h>
+#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/unistd.h>
@@ -116,10 +117,18 @@ void mdio_device_reset(struct mdio_device *mdiodev, int value)
{
unsigned int d;
- if (!mdiodev->reset)
+ if (!mdiodev->reset && !mdiodev->reset_ctrl)
return;
- gpiod_set_value(mdiodev->reset, value);
+ if (mdiodev->reset)
+ gpiod_set_value(mdiodev->reset, value);
+
+ if (mdiodev->reset_ctrl) {
+ if (value)
+ reset_control_assert(mdiodev->reset_ctrl);
+ else
+ reset_control_deassert(mdiodev->reset_ctrl);
+ }
d = value ? mdiodev->reset_assert_delay : mdiodev->reset_deassert_delay;
if (d)
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 3e99ae3ed87f..6eaf71500ef6 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -40,6 +40,7 @@ struct mdio_device {
int addr;
int flags;
struct gpio_desc *reset;
+ struct reset_control *reset_ctrl;
unsigned int reset_assert_delay;
unsigned int reset_deassert_delay;
};
--
2.21.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio
2019-04-15 12:38 [PATCH 1/3] dt-bindings: net: add PHY reset controller binding David Bauer
2019-04-15 12:38 ` [PATCH 2/3] net: phy: add support for reset-controller David Bauer
@ 2019-04-15 12:38 ` David Bauer
2019-04-15 17:02 ` Andrew Lunn
` (3 more replies)
2019-04-15 17:04 ` [PATCH 1/3] dt-bindings: net: add PHY reset controller binding Andrew Lunn
2 siblings, 4 replies; 9+ messages in thread
From: David Bauer @ 2019-04-15 12:38 UTC (permalink / raw)
To: devicetree, netdev
This renames the GPIO reset of mdio devices from 'reset' to
'reset_gpio' to better differentiate between GPIO and
reset-controller driven reset line.
Signed-off-by: David Bauer <mail@david-bauer.net>
---
drivers/net/phy/mdio_bus.c | 6 +++---
drivers/net/phy/mdio_device.c | 6 +++---
include/linux/mdio.h | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 7590645f19ef..d1087bd24c83 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -56,7 +56,7 @@ static int mdiobus_register_gpiod(struct mdio_device *mdiodev)
return PTR_ERR(gpiod);
}
- mdiodev->reset = gpiod;
+ mdiodev->reset_gpio = gpiod;
/* Assert the reset signal again */
mdio_device_reset(mdiodev, 1);
@@ -471,8 +471,8 @@ void mdiobus_unregister(struct mii_bus *bus)
if (!mdiodev)
continue;
- if (mdiodev->reset)
- gpiod_put(mdiodev->reset);
+ if (mdiodev->reset_gpio)
+ gpiod_put(mdiodev->reset_gpio);
mdiodev->device_remove(mdiodev);
mdiodev->device_free(mdiodev);
diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c
index 57668e0f9256..e282600bd83e 100644
--- a/drivers/net/phy/mdio_device.c
+++ b/drivers/net/phy/mdio_device.c
@@ -117,11 +117,11 @@ void mdio_device_reset(struct mdio_device *mdiodev, int value)
{
unsigned int d;
- if (!mdiodev->reset && !mdiodev->reset_ctrl)
+ if (!mdiodev->reset_gpio && !mdiodev->reset_ctrl)
return;
- if (mdiodev->reset)
- gpiod_set_value(mdiodev->reset, value);
+ if (mdiodev->reset_gpio)
+ gpiod_set_value(mdiodev->reset_gpio, value);
if (mdiodev->reset_ctrl) {
if (value)
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 6eaf71500ef6..9dc16d5705a1 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -39,7 +39,7 @@ struct mdio_device {
/* Bus address of the MDIO device (0-31) */
int addr;
int flags;
- struct gpio_desc *reset;
+ struct gpio_desc *reset_gpio;
struct reset_control *reset_ctrl;
unsigned int reset_assert_delay;
unsigned int reset_deassert_delay;
--
2.21.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] net: phy: add support for reset-controller
2019-04-15 12:38 ` [PATCH 2/3] net: phy: add support for reset-controller David Bauer
@ 2019-04-15 17:01 ` Andrew Lunn
0 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2019-04-15 17:01 UTC (permalink / raw)
To: David Bauer; +Cc: devicetree, netdev
On Mon, Apr 15, 2019 at 02:38:39PM +0200, David Bauer wrote:
> +static int mdiobus_register_reset(struct mdio_device *mdiodev)
> +{
> + struct reset_control *reset = NULL;
> +
> + if (mdiodev->dev.of_node)
> + reset = devm_reset_control_get_exclusive(&mdiodev->dev,
> + "phy");
> + if (PTR_ERR(reset) == -ENOENT ||
> + PTR_ERR(reset) == -ENOTSUPP)
> + reset = NULL;
> + else if (IS_ERR(reset))
> + return PTR_ERR(reset);
> +
> + mdiodev->reset_ctrl = reset;
> +
> + /* Assert the reset signal */
> + mdio_device_reset(mdiodev, 1);
Hi David
The mdiobus_register_gpiod() function also has a call to
mdio_device_reset(). So we end up resetting the GPIO twice.
It is probably better to pull this out of here, and
mdiobus_register_gpiod(), and do it once in mdiobus_register_device().
Andrew
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio
2019-04-15 12:38 ` [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio David Bauer
@ 2019-04-15 17:02 ` Andrew Lunn
2019-04-15 23:04 ` kbuild test robot
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2019-04-15 17:02 UTC (permalink / raw)
To: David Bauer; +Cc: devicetree, netdev
On Mon, Apr 15, 2019 at 02:38:40PM +0200, David Bauer wrote:
> This renames the GPIO reset of mdio devices from 'reset' to
> 'reset_gpio' to better differentiate between GPIO and
> reset-controller driven reset line.
>
> Signed-off-by: David Bauer <mail@david-bauer.net>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] dt-bindings: net: add PHY reset controller binding
2019-04-15 12:38 [PATCH 1/3] dt-bindings: net: add PHY reset controller binding David Bauer
2019-04-15 12:38 ` [PATCH 2/3] net: phy: add support for reset-controller David Bauer
2019-04-15 12:38 ` [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio David Bauer
@ 2019-04-15 17:04 ` Andrew Lunn
2 siblings, 0 replies; 9+ messages in thread
From: Andrew Lunn @ 2019-04-15 17:04 UTC (permalink / raw)
To: David Bauer; +Cc: devicetree, netdev
On Mon, Apr 15, 2019 at 02:38:38PM +0200, David Bauer wrote:
> Add the documentation for PHY reset lines controlled by a reset controller.
Hi David
When you respin, please add a patch 0/3 containing a cover note.
> Signed-off-by: David Bauer <mail@david-bauer.net>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio
2019-04-15 12:38 ` [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio David Bauer
2019-04-15 17:02 ` Andrew Lunn
@ 2019-04-15 23:04 ` kbuild test robot
2019-04-16 2:21 ` kbuild test robot
2019-04-16 2:29 ` kbuild test robot
3 siblings, 0 replies; 9+ messages in thread
From: kbuild test robot @ 2019-04-15 23:04 UTC (permalink / raw)
To: David Bauer; +Cc: kbuild-all, devicetree, netdev
[-- Attachment #1: Type: text/plain, Size: 3591 bytes --]
Hi David,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net/master]
[also build test ERROR on v5.1-rc5 next-20190415]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/David-Bauer/dt-bindings-net-add-PHY-reset-controller-binding/20190416-061343
config: i386-randconfig-x010-201915 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
drivers/net/phy/at803x.c: In function 'at803x_link_change_notify':
>> drivers/net/phy/at803x.c:337:19: error: 'struct mdio_device' has no member named 'reset'
if (phydev->mdio.reset && !priv->phy_reset) {
^
vim +337 drivers/net/phy/at803x.c
77a99394 Zhao Qiang 2014-03-28 324
13a56b44 Daniel Mack 2014-06-18 325 static void at803x_link_change_notify(struct phy_device *phydev)
13a56b44 Daniel Mack 2014-06-18 326 {
13a56b44 Daniel Mack 2014-06-18 327 struct at803x_priv *priv = phydev->priv;
13a56b44 Daniel Mack 2014-06-18 328
13a56b44 Daniel Mack 2014-06-18 329 /*
13a56b44 Daniel Mack 2014-06-18 330 * Conduct a hardware reset for AT8030 every time a link loss is
13a56b44 Daniel Mack 2014-06-18 331 * signalled. This is necessary to circumvent a hardware bug that
13a56b44 Daniel Mack 2014-06-18 332 * occurs when the cable is unplugged while TX packets are pending
13a56b44 Daniel Mack 2014-06-18 333 * in the FIFO. In such cases, the FIFO enters an error mode it
13a56b44 Daniel Mack 2014-06-18 334 * cannot recover from by software.
13a56b44 Daniel Mack 2014-06-18 335 */
13a56b44 Daniel Mack 2014-06-18 336 if (phydev->state == PHY_NOLINK) {
bafbdd52 Sergei Shtylyov 2017-12-04 @337 if (phydev->mdio.reset && !priv->phy_reset) {
13a56b44 Daniel Mack 2014-06-18 338 struct at803x_context context;
13a56b44 Daniel Mack 2014-06-18 339
13a56b44 Daniel Mack 2014-06-18 340 at803x_context_save(phydev, &context);
13a56b44 Daniel Mack 2014-06-18 341
bafbdd52 Sergei Shtylyov 2017-12-04 342 phy_device_reset(phydev, 1);
13a56b44 Daniel Mack 2014-06-18 343 msleep(1);
bafbdd52 Sergei Shtylyov 2017-12-04 344 phy_device_reset(phydev, 0);
d57019d1 Sergei Shtylyov 2016-03-23 345 msleep(1);
13a56b44 Daniel Mack 2014-06-18 346
13a56b44 Daniel Mack 2014-06-18 347 at803x_context_restore(phydev, &context);
13a56b44 Daniel Mack 2014-06-18 348
72ba48be Andrew Lunn 2016-01-06 349 phydev_dbg(phydev, "%s(): phy was reset\n",
13a56b44 Daniel Mack 2014-06-18 350 __func__);
13a56b44 Daniel Mack 2014-06-18 351 priv->phy_reset = true;
13a56b44 Daniel Mack 2014-06-18 352 }
13a56b44 Daniel Mack 2014-06-18 353 } else {
13a56b44 Daniel Mack 2014-06-18 354 priv->phy_reset = false;
13a56b44 Daniel Mack 2014-06-18 355 }
13a56b44 Daniel Mack 2014-06-18 356 }
13a56b44 Daniel Mack 2014-06-18 357
:::::: The code at line 337 was first introduced by commit
:::::: bafbdd527d569c8200521f2f7579f65a044271be phylib: Add device reset GPIO support
:::::: TO: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27237 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio
2019-04-15 12:38 ` [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio David Bauer
2019-04-15 17:02 ` Andrew Lunn
2019-04-15 23:04 ` kbuild test robot
@ 2019-04-16 2:21 ` kbuild test robot
2019-04-16 2:29 ` kbuild test robot
3 siblings, 0 replies; 9+ messages in thread
From: kbuild test robot @ 2019-04-16 2:21 UTC (permalink / raw)
To: David Bauer; +Cc: kbuild-all, devicetree, netdev
Hi David,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net/master]
[also build test WARNING on v5.1-rc5 next-20190415]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/David-Bauer/dt-bindings-net-add-PHY-reset-controller-binding/20190416-061343
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
sparse warnings: (new ones prefixed by >>)
drivers/net/phy/at803x.c:337:33: sparse: no member 'reset' in struct mdio_device
>> drivers/net/phy/at803x.c:337:33: sparse: unknown expression (8 46)
vim +337 drivers/net/phy/at803x.c
77a993942 Zhao Qiang 2014-03-28 324
13a56b449 Daniel Mack 2014-06-18 325 static void at803x_link_change_notify(struct phy_device *phydev)
13a56b449 Daniel Mack 2014-06-18 326 {
13a56b449 Daniel Mack 2014-06-18 327 struct at803x_priv *priv = phydev->priv;
13a56b449 Daniel Mack 2014-06-18 328
13a56b449 Daniel Mack 2014-06-18 329 /*
13a56b449 Daniel Mack 2014-06-18 330 * Conduct a hardware reset for AT8030 every time a link loss is
13a56b449 Daniel Mack 2014-06-18 331 * signalled. This is necessary to circumvent a hardware bug that
13a56b449 Daniel Mack 2014-06-18 332 * occurs when the cable is unplugged while TX packets are pending
13a56b449 Daniel Mack 2014-06-18 333 * in the FIFO. In such cases, the FIFO enters an error mode it
13a56b449 Daniel Mack 2014-06-18 334 * cannot recover from by software.
13a56b449 Daniel Mack 2014-06-18 335 */
13a56b449 Daniel Mack 2014-06-18 336 if (phydev->state == PHY_NOLINK) {
bafbdd527 Sergei Shtylyov 2017-12-04 @337 if (phydev->mdio.reset && !priv->phy_reset) {
13a56b449 Daniel Mack 2014-06-18 338 struct at803x_context context;
13a56b449 Daniel Mack 2014-06-18 339
13a56b449 Daniel Mack 2014-06-18 340 at803x_context_save(phydev, &context);
13a56b449 Daniel Mack 2014-06-18 341
bafbdd527 Sergei Shtylyov 2017-12-04 342 phy_device_reset(phydev, 1);
13a56b449 Daniel Mack 2014-06-18 343 msleep(1);
bafbdd527 Sergei Shtylyov 2017-12-04 344 phy_device_reset(phydev, 0);
d57019d18 Sergei Shtylyov 2016-03-23 345 msleep(1);
13a56b449 Daniel Mack 2014-06-18 346
13a56b449 Daniel Mack 2014-06-18 347 at803x_context_restore(phydev, &context);
13a56b449 Daniel Mack 2014-06-18 348
72ba48be3 Andrew Lunn 2016-01-06 349 phydev_dbg(phydev, "%s(): phy was reset\n",
13a56b449 Daniel Mack 2014-06-18 350 __func__);
13a56b449 Daniel Mack 2014-06-18 351 priv->phy_reset = true;
13a56b449 Daniel Mack 2014-06-18 352 }
13a56b449 Daniel Mack 2014-06-18 353 } else {
13a56b449 Daniel Mack 2014-06-18 354 priv->phy_reset = false;
13a56b449 Daniel Mack 2014-06-18 355 }
13a56b449 Daniel Mack 2014-06-18 356 }
13a56b449 Daniel Mack 2014-06-18 357
:::::: The code at line 337 was first introduced by commit
:::::: bafbdd527d569c8200521f2f7579f65a044271be phylib: Add device reset GPIO support
:::::: TO: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio
2019-04-15 12:38 ` [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio David Bauer
` (2 preceding siblings ...)
2019-04-16 2:21 ` kbuild test robot
@ 2019-04-16 2:29 ` kbuild test robot
3 siblings, 0 replies; 9+ messages in thread
From: kbuild test robot @ 2019-04-16 2:29 UTC (permalink / raw)
To: David Bauer; +Cc: kbuild-all, devicetree, netdev
[-- Attachment #1: Type: text/plain, Size: 4957 bytes --]
Hi David,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net/master]
[also build test WARNING on v5.1-rc5 next-20190415]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/David-Bauer/dt-bindings-net-add-PHY-reset-controller-binding/20190416-061343
config: i386-randconfig-x006-201915 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
In file included from include/linux/phy.h:19:0,
from drivers/net/phy/at803x.c:10:
drivers/net/phy/at803x.c: In function 'at803x_link_change_notify':
drivers/net/phy/at803x.c:337:19: error: 'struct mdio_device' has no member named 'reset'
if (phydev->mdio.reset && !priv->phy_reset) {
^
include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> drivers/net/phy/at803x.c:337:3: note: in expansion of macro 'if'
if (phydev->mdio.reset && !priv->phy_reset) {
^~
drivers/net/phy/at803x.c:337:19: error: 'struct mdio_device' has no member named 'reset'
if (phydev->mdio.reset && !priv->phy_reset) {
^
include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
if (__builtin_constant_p(!!(cond)) ? !!(cond) : \
^~~~
>> drivers/net/phy/at803x.c:337:3: note: in expansion of macro 'if'
if (phydev->mdio.reset && !priv->phy_reset) {
^~
drivers/net/phy/at803x.c:337:19: error: 'struct mdio_device' has no member named 'reset'
if (phydev->mdio.reset && !priv->phy_reset) {
^
include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
______r = !!(cond); \
^~~~
>> drivers/net/phy/at803x.c:337:3: note: in expansion of macro 'if'
if (phydev->mdio.reset && !priv->phy_reset) {
^~
vim +/if +337 drivers/net/phy/at803x.c
77a993942 Zhao Qiang 2014-03-28 324
13a56b449 Daniel Mack 2014-06-18 325 static void at803x_link_change_notify(struct phy_device *phydev)
13a56b449 Daniel Mack 2014-06-18 326 {
13a56b449 Daniel Mack 2014-06-18 327 struct at803x_priv *priv = phydev->priv;
13a56b449 Daniel Mack 2014-06-18 328
13a56b449 Daniel Mack 2014-06-18 329 /*
13a56b449 Daniel Mack 2014-06-18 330 * Conduct a hardware reset for AT8030 every time a link loss is
13a56b449 Daniel Mack 2014-06-18 331 * signalled. This is necessary to circumvent a hardware bug that
13a56b449 Daniel Mack 2014-06-18 332 * occurs when the cable is unplugged while TX packets are pending
13a56b449 Daniel Mack 2014-06-18 333 * in the FIFO. In such cases, the FIFO enters an error mode it
13a56b449 Daniel Mack 2014-06-18 334 * cannot recover from by software.
13a56b449 Daniel Mack 2014-06-18 335 */
13a56b449 Daniel Mack 2014-06-18 336 if (phydev->state == PHY_NOLINK) {
bafbdd527 Sergei Shtylyov 2017-12-04 @337 if (phydev->mdio.reset && !priv->phy_reset) {
13a56b449 Daniel Mack 2014-06-18 338 struct at803x_context context;
13a56b449 Daniel Mack 2014-06-18 339
13a56b449 Daniel Mack 2014-06-18 340 at803x_context_save(phydev, &context);
13a56b449 Daniel Mack 2014-06-18 341
bafbdd527 Sergei Shtylyov 2017-12-04 342 phy_device_reset(phydev, 1);
13a56b449 Daniel Mack 2014-06-18 343 msleep(1);
bafbdd527 Sergei Shtylyov 2017-12-04 344 phy_device_reset(phydev, 0);
d57019d18 Sergei Shtylyov 2016-03-23 345 msleep(1);
13a56b449 Daniel Mack 2014-06-18 346
13a56b449 Daniel Mack 2014-06-18 347 at803x_context_restore(phydev, &context);
13a56b449 Daniel Mack 2014-06-18 348
72ba48be3 Andrew Lunn 2016-01-06 349 phydev_dbg(phydev, "%s(): phy was reset\n",
13a56b449 Daniel Mack 2014-06-18 350 __func__);
13a56b449 Daniel Mack 2014-06-18 351 priv->phy_reset = true;
13a56b449 Daniel Mack 2014-06-18 352 }
13a56b449 Daniel Mack 2014-06-18 353 } else {
13a56b449 Daniel Mack 2014-06-18 354 priv->phy_reset = false;
13a56b449 Daniel Mack 2014-06-18 355 }
13a56b449 Daniel Mack 2014-06-18 356 }
13a56b449 Daniel Mack 2014-06-18 357
:::::: The code at line 337 was first introduced by commit
:::::: bafbdd527d569c8200521f2f7579f65a044271be phylib: Add device reset GPIO support
:::::: TO: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34277 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2019-04-16 2:30 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-15 12:38 [PATCH 1/3] dt-bindings: net: add PHY reset controller binding David Bauer
2019-04-15 12:38 ` [PATCH 2/3] net: phy: add support for reset-controller David Bauer
2019-04-15 17:01 ` Andrew Lunn
2019-04-15 12:38 ` [PATCH 3/3] net: mdio: rename mdio_device reset to reset_gpio David Bauer
2019-04-15 17:02 ` Andrew Lunn
2019-04-15 23:04 ` kbuild test robot
2019-04-16 2:21 ` kbuild test robot
2019-04-16 2:29 ` kbuild test robot
2019-04-15 17:04 ` [PATCH 1/3] dt-bindings: net: add PHY reset controller binding Andrew Lunn
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.