All of lore.kernel.org
 help / color / mirror / Atom feed
From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/8] net: pxa168_eth: fix Ethernet flow control status
Date: Wed, 10 Sep 2014 17:39:02 +0200	[thread overview]
Message-ID: <20140910153902.GE13342@lunn.ch> (raw)
In-Reply-To: <1410273848-24663-5-git-send-email-antoine.tenart@free-electrons.com>

On Tue, Sep 09, 2014 at 04:44:04PM +0200, Antoine Tenart wrote:
> IEEE 802.3x Ethernet flow control is disabled when bit (1 << 2) is set
> in the port status register. Fix the flow control detection in the link
> event handling function which was relying on the opposite assumption.
> 
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> ---
>  drivers/net/ethernet/marvell/pxa168_eth.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
> index 953112f87c5f..10422f2df6cc 100644
> --- a/drivers/net/ethernet/marvell/pxa168_eth.c
> +++ b/drivers/net/ethernet/marvell/pxa168_eth.c
> @@ -163,7 +163,7 @@
>  /* Bit definitions for Port status */
>  #define PORT_SPEED_100		(1 << 0)
>  #define FULL_DUPLEX		(1 << 1)
> -#define FLOW_CONTROL_ENABLED	(1 << 2)
> +#define FLOW_CONTROL_DISABLED	(1 << 2)
>  #define LINK_UP			(1 << 3)
>  
>  /* Bit definitions for work to be done */
> @@ -885,7 +885,7 @@ static void handle_link_event(struct pxa168_eth_private *pep)
>  		speed = 10;
>  
>  	duplex = (port_status & FULL_DUPLEX) ? 1 : 0;
> -	fc = (port_status & FLOW_CONTROL_ENABLED) ? 1 : 0;
> +	fc = (port_status & FLOW_CONTROL_DISABLED) ? 0 : 1;
>  	netdev_info(dev, "link up, %d Mb/s, %s duplex, flow control %sabled\n",
>  		    speed, duplex ? "full" : "half", fc ? "en" : "dis");
>  	if (!netif_carrier_ok(dev))

Could this be a hardware bug which has been fixed in a newer version
of the IP? It would be good to have this tested on an old platform
using this driver.

   Andrew

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
To: Antoine Tenart
	<antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
	zmxu-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org,
	jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v2 4/8] net: pxa168_eth: fix Ethernet flow control status
Date: Wed, 10 Sep 2014 17:39:02 +0200	[thread overview]
Message-ID: <20140910153902.GE13342@lunn.ch> (raw)
In-Reply-To: <1410273848-24663-5-git-send-email-antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>

On Tue, Sep 09, 2014 at 04:44:04PM +0200, Antoine Tenart wrote:
> IEEE 802.3x Ethernet flow control is disabled when bit (1 << 2) is set
> in the port status register. Fix the flow control detection in the link
> event handling function which was relying on the opposite assumption.
> 
> Signed-off-by: Antoine Tenart <antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> ---
>  drivers/net/ethernet/marvell/pxa168_eth.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
> index 953112f87c5f..10422f2df6cc 100644
> --- a/drivers/net/ethernet/marvell/pxa168_eth.c
> +++ b/drivers/net/ethernet/marvell/pxa168_eth.c
> @@ -163,7 +163,7 @@
>  /* Bit definitions for Port status */
>  #define PORT_SPEED_100		(1 << 0)
>  #define FULL_DUPLEX		(1 << 1)
> -#define FLOW_CONTROL_ENABLED	(1 << 2)
> +#define FLOW_CONTROL_DISABLED	(1 << 2)
>  #define LINK_UP			(1 << 3)
>  
>  /* Bit definitions for work to be done */
> @@ -885,7 +885,7 @@ static void handle_link_event(struct pxa168_eth_private *pep)
>  		speed = 10;
>  
>  	duplex = (port_status & FULL_DUPLEX) ? 1 : 0;
> -	fc = (port_status & FLOW_CONTROL_ENABLED) ? 1 : 0;
> +	fc = (port_status & FLOW_CONTROL_DISABLED) ? 0 : 1;
>  	netdev_info(dev, "link up, %d Mb/s, %s duplex, flow control %sabled\n",
>  		    speed, duplex ? "full" : "half", fc ? "en" : "dis");
>  	if (!netif_carrier_ok(dev))

Could this be a hardware bug which has been fixed in a newer version
of the IP? It would be good to have this tested on an old platform
using this driver.

   Andrew
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew@lunn.ch>
To: Antoine Tenart <antoine.tenart@free-electrons.com>
Cc: sebastian.hesselbarth@gmail.com,
	thomas.petazzoni@free-electrons.com, zmxu@marvell.com,
	devicetree@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	alexandre.belloni@free-electrons.com, jszhang@marvell.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 4/8] net: pxa168_eth: fix Ethernet flow control status
Date: Wed, 10 Sep 2014 17:39:02 +0200	[thread overview]
Message-ID: <20140910153902.GE13342@lunn.ch> (raw)
In-Reply-To: <1410273848-24663-5-git-send-email-antoine.tenart@free-electrons.com>

On Tue, Sep 09, 2014 at 04:44:04PM +0200, Antoine Tenart wrote:
> IEEE 802.3x Ethernet flow control is disabled when bit (1 << 2) is set
> in the port status register. Fix the flow control detection in the link
> event handling function which was relying on the opposite assumption.
> 
> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> ---
>  drivers/net/ethernet/marvell/pxa168_eth.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
> index 953112f87c5f..10422f2df6cc 100644
> --- a/drivers/net/ethernet/marvell/pxa168_eth.c
> +++ b/drivers/net/ethernet/marvell/pxa168_eth.c
> @@ -163,7 +163,7 @@
>  /* Bit definitions for Port status */
>  #define PORT_SPEED_100		(1 << 0)
>  #define FULL_DUPLEX		(1 << 1)
> -#define FLOW_CONTROL_ENABLED	(1 << 2)
> +#define FLOW_CONTROL_DISABLED	(1 << 2)
>  #define LINK_UP			(1 << 3)
>  
>  /* Bit definitions for work to be done */
> @@ -885,7 +885,7 @@ static void handle_link_event(struct pxa168_eth_private *pep)
>  		speed = 10;
>  
>  	duplex = (port_status & FULL_DUPLEX) ? 1 : 0;
> -	fc = (port_status & FLOW_CONTROL_ENABLED) ? 1 : 0;
> +	fc = (port_status & FLOW_CONTROL_DISABLED) ? 0 : 1;
>  	netdev_info(dev, "link up, %d Mb/s, %s duplex, flow control %sabled\n",
>  		    speed, duplex ? "full" : "half", fc ? "en" : "dis");
>  	if (!netif_carrier_ok(dev))

Could this be a hardware bug which has been fixed in a newer version
of the IP? It would be good to have this tested on an old platform
using this driver.

   Andrew

  reply	other threads:[~2014-09-10 15:39 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09 14:44 [PATCH v2 0/8] ARM: Berlin: Ethernet support Antoine Tenart
2014-09-09 14:44 ` Antoine Tenart
2014-09-09 14:44 ` Antoine Tenart
2014-09-09 14:44 ` [PATCH v2 1/8] net: pxa168_eth: clean up Antoine Tenart
2014-09-09 14:44   ` Antoine Tenart
2014-09-09 14:44   ` Antoine Tenart
2014-09-09 14:44 ` [PATCH v2 2/8] net: pxa168_eth: add device tree support Antoine Tenart
2014-09-09 14:44   ` Antoine Tenart
2014-09-09 14:44   ` Antoine Tenart
2014-09-09 14:44 ` [PATCH v2 3/8] Documentation: bindings: net: add the Marvell PXA168 Ethernet controller Antoine Tenart
2014-09-09 14:44   ` Antoine Tenart
2014-09-09 14:44   ` Antoine Tenart
2014-09-09 15:58   ` Arnd Bergmann
2014-09-09 15:58     ` Arnd Bergmann
2014-09-09 16:01     ` Antoine Tenart
2014-09-09 16:01       ` Antoine Tenart
2014-09-09 16:01       ` Antoine Tenart
2014-09-09 17:47       ` Arnd Bergmann
2014-09-09 17:47         ` Arnd Bergmann
2014-09-09 17:47         ` Arnd Bergmann
2014-09-09 17:52         ` Mark Rutland
2014-09-09 17:52           ` Mark Rutland
2014-09-09 17:52           ` Mark Rutland
2014-09-09 14:44 ` [PATCH v2 4/8] net: pxa168_eth: fix Ethernet flow control status Antoine Tenart
2014-09-09 14:44   ` Antoine Tenart
2014-09-10 15:39   ` Andrew Lunn [this message]
2014-09-10 15:39     ` Andrew Lunn
2014-09-10 15:39     ` Andrew Lunn
2014-09-10 17:44     ` Antoine Tenart
2014-09-10 17:44       ` Antoine Tenart
2014-09-10 17:44       ` Antoine Tenart
2014-09-09 14:44 ` [PATCH v2 5/8] net: pxa168_eth: get and set the mac address on the Ethernet controller Antoine Tenart
2014-09-09 14:44   ` Antoine Tenart
2014-09-09 15:59   ` Arnd Bergmann
2014-09-09 15:59     ` Arnd Bergmann
2014-09-09 16:29   ` Jason Cooper
2014-09-09 16:29     ` Jason Cooper
2014-09-09 16:29     ` Jason Cooper
2014-09-09 16:36     ` Antoine Tenart
2014-09-09 16:36       ` Antoine Tenart
2014-09-09 16:36       ` Antoine Tenart
2014-09-09 14:44 ` [PATCH v2 6/8] net: pxa168_eth: allow Berlin SoCs to use the pxa168_eth driver Antoine Tenart
2014-09-09 14:44   ` Antoine Tenart
2014-09-09 14:44 ` [PATCH v2 7/8] ARM: dts: berlin: add the Ethernet node Antoine Tenart
2014-09-09 14:44   ` Antoine Tenart
2014-09-09 14:44 ` [PATCH v2 8/8] ARM: dts: berlin: enable the Ethernet port on the BG2Q DMP Antoine Tenart
2014-09-09 14:44   ` Antoine Tenart

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=20140910153902.GE13342@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 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.