All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: George McCollister <george.mccollister@gmail.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Tristram Ha <Tristram.Ha@microchip.com>,
	Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
	Woojung Huh <woojung.huh@microchip.com>
Subject: Re: [PATCH V2] net: dsa: microchip: Always set regmap stride to 1
Date: Sat, 28 Sep 2019 03:56:25 +0200	[thread overview]
Message-ID: <638f42ee-bb8e-0217-df09-665ddd795ad5@denx.de> (raw)
In-Reply-To: <CAFSKS=PFBewpMiMXuPmJXqv=sbYhS8_9k=DrwAXjjPNi7xFwcA@mail.gmail.com>

On 9/26/19 3:52 PM, George McCollister wrote:
> On Wed, Sep 25, 2019 at 5:08 PM 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.
> 
> After looking through a couple hundred pages of register documentation
> for KSZ9477 and KSZ9567 I find only registers that are aligned to
> their width. In my testing the KSZ9567 works fine with and without the
> patch. The only downside is that all of the unaligned registers
> needlessly show up in the debugfs regmap, this doesn't really matter
> though. As long as it fixes the issues on KSZ87xx this looks fine to
> me.

Right.

To avoid exposing all registers through regmap debugfs entries, we would
have to define the regmap constrains for
readable/writeable/volatile/precious registers, which we should
eventually do anyway, but that's way beyond the scope of this fix.

  reply	other threads:[~2019-09-28  1:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 22:08 [PATCH V2] net: dsa: microchip: Always set regmap stride to 1 Marek Vasut
2019-09-26 13:52 ` George McCollister
2019-09-28  1:56   ` Marek Vasut [this message]
2019-09-27 18:21 ` David Miller

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=638f42ee-bb8e-0217-df09-665ddd795ad5@denx.de \
    --to=marex@denx.de \
    --cc=Tristram.Ha@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=george.mccollister@gmail.com \
    --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 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.