netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] net: smsc911x: Fix bug where PHY interrupts are overwritten by 0
@ 2016-06-16 15:54 Jeremy Linton
  2016-06-16 16:33 ` Andrew Lunn
  2016-06-16 18:55 ` Sergei Shtylyov
  0 siblings, 2 replies; 4+ messages in thread
From: Jeremy Linton @ 2016-06-16 15:54 UTC (permalink / raw)
  To: netdev; +Cc: steve.glendinning, andrew, sergei.shtylyov

By default, mdiobus_alloc() sets the PHY's to polling mode, but a
pointer size memcpy means that couple IRQs (depending
on 32-bit or 64-bit kernels) end up being overwritten with
a value of 0. This means that PHY_POLL is disabled and results
in unpredictable behavior depending on the PHYs location on the mdio
bus. Remove that memcpy and the now unused phy_irq member to force
SMSC911x PHY's into polling mode 100% of the time.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
---
 drivers/net/ethernet/smsc/smsc911x.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 8af2556..b5ab5e1 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -116,7 +116,6 @@ struct smsc911x_data {
 
 	struct phy_device *phy_dev;
 	struct mii_bus *mii_bus;
-	int phy_irq[PHY_MAX_ADDR];
 	unsigned int using_extphy;
 	int last_duplex;
 	int last_carrier;
@@ -1073,7 +1072,6 @@ static int smsc911x_mii_init(struct platform_device *pdev,
 	pdata->mii_bus->priv = pdata;
 	pdata->mii_bus->read = smsc911x_mii_read;
 	pdata->mii_bus->write = smsc911x_mii_write;
-	memcpy(pdata->mii_bus->irq, pdata->phy_irq, sizeof(pdata->mii_bus));
 
 	pdata->mii_bus->parent = &pdev->dev;
 
-- 
2.5.5

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

* Re: [PATCH 1/2] net: smsc911x: Fix bug where PHY interrupts are overwritten by 0
  2016-06-16 15:54 [PATCH 1/2] net: smsc911x: Fix bug where PHY interrupts are overwritten by 0 Jeremy Linton
@ 2016-06-16 16:33 ` Andrew Lunn
  2016-06-16 18:55 ` Sergei Shtylyov
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2016-06-16 16:33 UTC (permalink / raw)
  To: Jeremy Linton; +Cc: netdev, steve.glendinning, sergei.shtylyov

On Thu, Jun 16, 2016 at 10:54:30AM -0500, Jeremy Linton wrote:
> By default, mdiobus_alloc() sets the PHY's to polling mode, but a
> pointer size memcpy means that couple IRQs (depending
> on 32-bit or 64-bit kernels) end up being overwritten with
> a value of 0. This means that PHY_POLL is disabled and results
> in unpredictable behavior depending on the PHYs location on the mdio
> bus. Remove that memcpy and the now unused phy_irq member to force
> SMSC911x PHY's into polling mode 100% of the time.
> 
> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>

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

    Andrew

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

* Re: [PATCH 1/2] net: smsc911x: Fix bug where PHY interrupts are overwritten by 0
  2016-06-16 15:54 [PATCH 1/2] net: smsc911x: Fix bug where PHY interrupts are overwritten by 0 Jeremy Linton
  2016-06-16 16:33 ` Andrew Lunn
@ 2016-06-16 18:55 ` Sergei Shtylyov
  2016-06-16 19:53   ` Sergei Shtylyov
  1 sibling, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2016-06-16 18:55 UTC (permalink / raw)
  To: Jeremy Linton, netdev; +Cc: steve.glendinning, andrew

On 06/16/2016 06:54 PM, Jeremy Linton wrote:

> By default, mdiobus_alloc() sets the PHY's to polling mode, but a

    Rather "PHYs".

> pointer size memcpy means that couple IRQs (depending

    Could be more words on this line, it's broken too early, I think.

> on 32-bit or 64-bit kernels) end up being overwritten with
> a value of 0. This means that PHY_POLL is disabled and results
> in unpredictable behavior depending on the PHYs location on the mdio

    Contrariwise, "PHY's" here. And it's MDIO.

> bus. Remove that memcpy and the now unused phy_irq member to force
> SMSC911x PHY's into polling mode 100% of the time.
>
> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>

Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

[...]

MBR, Sergei

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

* Re: [PATCH 1/2] net: smsc911x: Fix bug where PHY interrupts are overwritten by 0
  2016-06-16 18:55 ` Sergei Shtylyov
@ 2016-06-16 19:53   ` Sergei Shtylyov
  0 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2016-06-16 19:53 UTC (permalink / raw)
  To: Jeremy Linton, netdev; +Cc: steve.glendinning, andrew

On 06/16/2016 09:55 PM, Sergei Shtylyov wrote:

>> By default, mdiobus_alloc() sets the PHY's to polling mode, but a
>
>    Rather "PHYs".
>
>> pointer size memcpy means that couple IRQs (depending
>
>    Could be more words on this line, it's broken too early, I think.
>
>> on 32-bit or 64-bit kernels) end up being overwritten with
>> a value of 0. This means that PHY_POLL is disabled and results
>> in unpredictable behavior depending on the PHYs location on the mdio
>
>    Contrariwise, "PHY's" here. And it's MDIO.
>
>> bus. Remove that memcpy and the now unused phy_irq member to force
>> SMSC911x PHY's into polling mode 100% of the time.
>>
>> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
>
> Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

    I was going to add the following too but just forgot:

Fixes: e7f4dc3536a4 ("mdio: Move allocation of interrupts into core")

> [...]

MBR, Sergei

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

end of thread, other threads:[~2016-06-16 19:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-16 15:54 [PATCH 1/2] net: smsc911x: Fix bug where PHY interrupts are overwritten by 0 Jeremy Linton
2016-06-16 16:33 ` Andrew Lunn
2016-06-16 18:55 ` Sergei Shtylyov
2016-06-16 19:53   ` Sergei Shtylyov

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