All of lore.kernel.org
 help / color / mirror / Atom feed
From: gregory.clement@free-electrons.com (Gregory CLEMENT)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH net-next v6 1/4] net: dsa: mv88e6xxx: Don't forbid MDIO I/Os for PHY addr >= num_of_ports
Date: Tue, 24 Jan 2017 21:31:59 +0100	[thread overview]
Message-ID: <87inp42o8w.fsf@free-electrons.com> (raw)
In-Reply-To: <7665c54a8da0d4338d5935ab272952ea6547d815.1485288602.git-series.gregory.clement@free-electrons.com> (Gregory CLEMENT's message of "Tue, 24 Jan 2017 21:10:23 +0100")

Hi,
 
 On mar., janv. 24 2017, Gregory CLEMENT <gregory.clement@free-electrons.com> wrote:

> From: Romain Perier <romain.perier@free-electrons.com>
>
> Some Marvell ethernet switches have internal ethernet transceivers with
> hardcoded phy addresses. These addresses can be greater than the number
> of ports or its value might be different than the associated port number.
> This is for example the case for MV88E6341 that has 6 ports and internal
> Port 1 to Port4 PHYs mapped at SMI addresses from 0x11 to 0x14.
>
> This commits fixes the issue by removing the condition in MDIO callbacks.
>
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
This flag is missing:
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Actually I added during an interactive rebase, but I had to abort it
and it was lost.

Gregory


> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> ---
>  drivers/net/dsa/mv88e6xxx/chip.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index c7e08e13bb54..7d942f8a42a7 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -2882,9 +2882,6 @@ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg)
>  	u16 val;
>  	int err;
>  
> -	if (phy >= mv88e6xxx_num_ports(chip))
> -		return 0xffff;
> -
>  	mutex_lock(&chip->reg_lock);
>  	err = mv88e6xxx_phy_read(chip, phy, reg, &val);
>  	mutex_unlock(&chip->reg_lock);
> @@ -2897,9 +2894,6 @@ static int mv88e6xxx_mdio_write(struct mii_bus *bus, int phy, int reg, u16 val)
>  	struct mv88e6xxx_chip *chip = bus->priv;
>  	int err;
>  
> -	if (phy >= mv88e6xxx_num_ports(chip))
> -		return 0xffff;
> -
>  	mutex_lock(&chip->reg_lock);
>  	err = mv88e6xxx_phy_write(chip, phy, reg, val);
>  	mutex_unlock(&chip->reg_lock);
> -- 
> git-series 0.9.1

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

WARNING: multiple messages have this Message-ID (diff)
From: Gregory CLEMENT <gregory.clement@free-electrons.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Jason Cooper <jason@lakedaemon.net>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	linux-arm-kernel@lists.infradead.org,
	Nadav Haklai <nadavh@marvell.com>,
	Wilson Ding <dingwei@marvell.com>,
	Kostya Porotchkin <kostap@marvell.com>,
	Joe Zhou <shjzhou@marvell.com>,
	Jon Pannell <jpannell@marvell.com>
Subject: Re: [PATCH net-next v6 1/4] net: dsa: mv88e6xxx: Don't forbid MDIO I/Os for PHY addr >= num_of_ports
Date: Tue, 24 Jan 2017 21:31:59 +0100	[thread overview]
Message-ID: <87inp42o8w.fsf@free-electrons.com> (raw)
In-Reply-To: <7665c54a8da0d4338d5935ab272952ea6547d815.1485288602.git-series.gregory.clement@free-electrons.com> (Gregory CLEMENT's message of "Tue, 24 Jan 2017 21:10:23 +0100")

Hi,
 
 On mar., janv. 24 2017, Gregory CLEMENT <gregory.clement@free-electrons.com> wrote:

> From: Romain Perier <romain.perier@free-electrons.com>
>
> Some Marvell ethernet switches have internal ethernet transceivers with
> hardcoded phy addresses. These addresses can be greater than the number
> of ports or its value might be different than the associated port number.
> This is for example the case for MV88E6341 that has 6 ports and internal
> Port 1 to Port4 PHYs mapped at SMI addresses from 0x11 to 0x14.
>
> This commits fixes the issue by removing the condition in MDIO callbacks.
>
> Signed-off-by: Romain Perier <romain.perier@free-electrons.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
This flag is missing:
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>

Actually I added during an interactive rebase, but I had to abort it
and it was lost.

Gregory


> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> ---
>  drivers/net/dsa/mv88e6xxx/chip.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index c7e08e13bb54..7d942f8a42a7 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -2882,9 +2882,6 @@ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg)
>  	u16 val;
>  	int err;
>  
> -	if (phy >= mv88e6xxx_num_ports(chip))
> -		return 0xffff;
> -
>  	mutex_lock(&chip->reg_lock);
>  	err = mv88e6xxx_phy_read(chip, phy, reg, &val);
>  	mutex_unlock(&chip->reg_lock);
> @@ -2897,9 +2894,6 @@ static int mv88e6xxx_mdio_write(struct mii_bus *bus, int phy, int reg, u16 val)
>  	struct mv88e6xxx_chip *chip = bus->priv;
>  	int err;
>  
> -	if (phy >= mv88e6xxx_num_ports(chip))
> -		return 0xffff;
> -
>  	mutex_lock(&chip->reg_lock);
>  	err = mv88e6xxx_phy_write(chip, phy, reg, val);
>  	mutex_unlock(&chip->reg_lock);
> -- 
> git-series 0.9.1

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  reply	other threads:[~2017-01-24 20:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-24 20:10 [PATCH net-next v6 0/4] Add support for the ethernet switch on the ESPRESSObin Gregory CLEMENT
2017-01-24 20:10 ` Gregory CLEMENT
2017-01-24 20:10 ` [PATCH net-next v6 1/4] net: dsa: mv88e6xxx: Don't forbid MDIO I/Os for PHY addr >= num_of_ports Gregory CLEMENT
2017-01-24 20:10   ` Gregory CLEMENT
2017-01-24 20:31   ` Gregory CLEMENT [this message]
2017-01-24 20:31     ` Gregory CLEMENT
2017-01-24 20:10 ` [PATCH net-next v6 2/4] net: dsa: mv88e6xxx: Add support for ethernet switch 88E6341 Gregory CLEMENT
2017-01-24 20:10   ` Gregory CLEMENT
2017-01-25  2:02   ` Andrew Lunn
2017-01-25  2:02     ` Andrew Lunn
2017-01-25  7:55     ` Gregory CLEMENT
2017-01-25  7:55       ` Gregory CLEMENT
2017-01-25 18:58       ` Jon Pannell
2017-01-25 18:58         ` Jon Pannell
2017-01-25 18:58         ` Jon Pannell
2017-01-24 20:10 ` [PATCH net-next v6 3/4] net: dsa: mv88e6xxx: Add support for ethernet switch 88E6141 Gregory CLEMENT
2017-01-24 20:10   ` Gregory CLEMENT
2017-01-24 20:10 ` [PATCH net-next v6 4/4] phy: marvell: Add support for the PHY embedded in the topaz switch Gregory CLEMENT
2017-01-24 20:10   ` Gregory CLEMENT
2017-01-24 20:28   ` Andrew Lunn
2017-01-24 20:28     ` Andrew Lunn
2017-01-24 20:55     ` Gregory CLEMENT
2017-01-24 20:55       ` Gregory CLEMENT

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=87inp42o8w.fsf@free-electrons.com \
    --to=gregory.clement@free-electrons.com \
    --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.