netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Marek Vasut <marex@denx.de>, netdev@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	George McCollister <george.mccollister@gmail.com>,
	Tristram Ha <Tristram.Ha@microchip.com>,
	Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
	Woojung Huh <woojung.huh@microchip.com>
Subject: Re: [PATCH] net: dsa: microchip: Always set regmap stride to 1
Date: Sun, 22 Sep 2019 10:58:54 -0700	[thread overview]
Message-ID: <0250f01c-f536-8d15-8da0-0318ac8aecc9@gmail.com> (raw)
In-Reply-To: <20190921175309.2195-1-marex@denx.de>



On 9/21/2019 10:53 AM, Marek Vasut wrote:
> The regmap stride is set to 1 for regmap describing 8bit registers already.
> However, for 16/32/64bit registers, the stride is 2/4/8 respectively. This
> is not correct, as the switch protocol supports unaligned register reads
> and writes and the KSZ87xx even uses such unaligned register accesses to
> read e.g. MIB counter.
> 
> This patch fixes MIB counter access on KSZ87xx.

Should that be having the following Fixes tag(s):

Fixes: 46558d601cb6 ("net: dsa: microchip: Initial SPI regmap support")

and where relevant:

Fixes: 255b59ad0db2 ("net: dsa: microchip: Factor out regmap config
generation into common header")


> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: George McCollister <george.mccollister@gmail.com>
> Cc: Tristram Ha <Tristram.Ha@microchip.com>
> Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
> Cc: Woojung Huh <woojung.huh@microchip.com>
> ---
>  drivers/net/dsa/microchip/ksz_common.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
> index a24d8e61fbe7..dd60d0837fc6 100644
> --- a/drivers/net/dsa/microchip/ksz_common.h
> +++ b/drivers/net/dsa/microchip/ksz_common.h
> @@ -303,7 +303,7 @@ static inline void ksz_pwrite32(struct ksz_device *dev, int port, int offset,
>  	{								\
>  		.name = #width,						\
>  		.val_bits = (width),					\
> -		.reg_stride = (width) / 8,				\
> +		.reg_stride = 1,					\
>  		.reg_bits = (regbits) + (regalign),			\
>  		.pad_bits = (regpad),					\
>  		.max_register = BIT(regbits) - 1,			\
> 

-- 
Florian

  reply	other threads:[~2019-09-22 17:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-21 17:53 [PATCH] net: dsa: microchip: Always set regmap stride to 1 Marek Vasut
2019-09-22 17:58 ` Florian Fainelli [this message]
2019-09-25 11:44 ` David Miller
2019-09-25 22:09   ` Marek Vasut

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=0250f01c-f536-8d15-8da0-0318ac8aecc9@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=Tristram.Ha@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=george.mccollister@gmail.com \
    --cc=marex@denx.de \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@savoirfairelinux.com \
    --cc=woojung.huh@microchip.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).