netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Jeremy Linton <jeremy.linton@arm.com>,
	netdev@vger.kernel.org, steve.glendinning@shawell.net
Subject: Re: [PATCH] net: smsc911x: If PHY doesn't have an interrupt then POLL
Date: Tue, 14 Jun 2016 22:12:43 +0200	[thread overview]
Message-ID: <20160614201243.GC8518@lunn.ch> (raw)
In-Reply-To: <0b8c79f9-f938-8357-fb6a-af49ada03fda@cogentembedded.com>

On Tue, Jun 14, 2016 at 10:49:20PM +0300, Sergei Shtylyov wrote:
> On 06/14/2016 10:27 PM, Sergei Shtylyov wrote:
> 
> >>>If the interrupt configuration isn't set and we are using the
> >>>internal phy, then we need to poll the phy to reliably detect
> >>>phy state changes.
> >>>
> >>>Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
> >>>---
> >>> drivers/net/ethernet/smsc/smsc911x.c | 3 +++
> >>> 1 file changed, 3 insertions(+)
> >>>
> >>>diff --git a/drivers/net/ethernet/smsc/smsc911x.c
> >>>b/drivers/net/ethernet/smsc/smsc911x.c
> >>>index 8af2556..369dc7d 100644
> >>>--- a/drivers/net/ethernet/smsc/smsc911x.c
> >>>+++ b/drivers/net/ethernet/smsc/smsc911x.c
> >>>@@ -1020,6 +1020,9 @@ static int smsc911x_mii_probe(struct net_device *dev)
> >>>         return -ENODEV;
> >>>     }
> >>>
> >>>+    if ((!phydev->irq) && (!pdata->using_extphy))
> >>
> >>   Inner parens aren't needed at all.
> >
> >   Hm, 'phydev->irq' shouldn't be 0 in the first place. It seems to me we
> >should correctly initialize 'pdata->phy_irq[]' in smsc911x_mii_init()...

Hi Sergei

The mdio layer, when it allocates the mdiobus structure, will
initialise all the phy interrupts to polling.

>    And looking at that array, I doubt it's really useful for
> anything... And the memcpy() there seems buggy as well -- it copies
> just 4 bytes of this array to 'pdata->mii_bus->irq'.

0 is not a valid interrupt. So it should probably loop over the array
and copy any which are not 0 into pdata->mii_bus->irq[].

    Andrew

  reply	other threads:[~2016-06-14 20:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14 16:16 [PATCH] net: smsc911x: If PHY doesn't have an interrupt then POLL Jeremy Linton
2016-06-14 18:30 ` Sergei Shtylyov
2016-06-14 19:27   ` Sergei Shtylyov
2016-06-14 19:49     ` Sergei Shtylyov
2016-06-14 20:12       ` Andrew Lunn [this message]
2016-06-14 20:21         ` Sergei Shtylyov
2016-06-14 20:13       ` Jeremy Linton
2016-06-14 18:42 ` Andrew Lunn
2016-06-14 20:48   ` Jeremy Linton
2016-06-14 20:44 ` Sergei Shtylyov
2016-06-14 20:59   ` Jeremy Linton
2016-06-14 21:24     ` Sergei Shtylyov
2016-06-14 22:26     ` Andrew Lunn
2016-06-15 15:50       ` Jeremy Linton
2016-06-14 21:02   ` Jeremy Linton
2016-06-14 21:12   ` Jeremy Linton
2016-06-14 21:26     ` Sergei Shtylyov
2016-06-14 21:29   ` Jeremy Linton
2016-06-14 21:34     ` Sergei Shtylyov
2016-06-14 21:40       ` Jeremy Linton
2016-06-14 21:42         ` Sergei Shtylyov
2016-06-14 21:53           ` Jeremy Linton
2016-06-14 21:56             ` Sergei Shtylyov
2016-06-15 15:56               ` Jeremy Linton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160614201243.GC8518@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=jeremy.linton@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=steve.glendinning@shawell.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).