From: <Tristram.Ha@microchip.com>
To: <Razvan.Stefanescu@microchip.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<Razvan.Stefanescu@microchip.com>, <Woojung.Huh@microchip.com>,
<vivien.didelot@gmail.com>, <UNGLinuxDriver@microchip.com>,
<andrew@lunn.ch>, <f.fainelli@gmail.com>, <davem@davemloft.net>
Subject: RE: [PATCH 4/4] net: dsa: microchip: avoid hard-codded port count
Date: Tue, 27 Aug 2019 21:03:27 +0000 [thread overview]
Message-ID: <MN2PR11MB3678CF331310105FA5916A56ECA00@MN2PR11MB3678.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20190827093110.14957-5-razvan.stefanescu@microchip.com>
> Subject: [PATCH 4/4] net: dsa: microchip: avoid hard-codded port count
>
> Use port_cnt value to disable interrupts on switch reset.
>
> Signed-off-by: Razvan Stefanescu <razvan.stefanescu@microchip.com>
> ---
> drivers/net/dsa/microchip/ksz9477.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/microchip/ksz9477.c
> b/drivers/net/dsa/microchip/ksz9477.c
> index 187be42de5f1..54fc05595d48 100644
> --- a/drivers/net/dsa/microchip/ksz9477.c
> +++ b/drivers/net/dsa/microchip/ksz9477.c
> @@ -213,7 +213,7 @@ static int ksz9477_reset_switch(struct ksz_device
> *dev)
>
> /* disable interrupts */
> ksz_write32(dev, REG_SW_INT_MASK__4, SWITCH_INT_MASK);
> - ksz_write32(dev, REG_SW_PORT_INT_MASK__4, 0x7F);
> + ksz_write32(dev, REG_SW_PORT_INT_MASK__4, dev->port_cnt);
> ksz_read32(dev, REG_SW_PORT_INT_STATUS__4, &data32);
>
> /* set broadcast storm protection 10% rate */
The register value is a portmap, so using port_cnt may be wrong.
The chip is a 7-port switch. There is a 6-port variant, but it is okay to write 0x7F.
There is also a 3-port variant which uses a different design. It is a bit of stretch to use 0x7F on it.
It is more a code readability or correctness than incorrect hardware operation.
prev parent reply other threads:[~2019-08-27 21:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-27 9:31 [PATCH 0/4] net: dsa: microchip: add KSZ8563 support Razvan Stefanescu
2019-08-27 9:31 ` [PATCH 1/4] dt-bindings: net: dsa: document additional Microchip KSZ8563 switch Razvan Stefanescu
2019-08-27 9:31 ` [PATCH 2/4] net: dsa: microchip: add KSZ8563 compatibility string Razvan Stefanescu
2019-08-27 9:31 ` [PATCH 3/4] net: dsa: microchip: fix interrupt mask Razvan Stefanescu
2019-08-27 12:51 ` Andrew Lunn
2019-08-27 13:22 ` Razvan.Stefanescu
2019-08-27 20:56 ` Tristram.Ha
2019-08-27 9:31 ` [PATCH 4/4] net: dsa: microchip: avoid hard-codded port count Razvan Stefanescu
2019-08-27 12:55 ` Andrew Lunn
2019-08-27 21:03 ` Tristram.Ha [this message]
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=MN2PR11MB3678CF331310105FA5916A56ECA00@MN2PR11MB3678.namprd11.prod.outlook.com \
--to=tristram.ha@microchip.com \
--cc=Razvan.Stefanescu@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=Woojung.Huh@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@gmail.com \
/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).