From: Simon Horman <horms@kernel.org>
To: Jesse Van Gavere <jesseevg@gmail.com>
Cc: netdev@vger.kernel.org, woojung.huh@microchip.com,
UNGLinuxDriver@microchip.com, andrew@lunn.ch, olteanv@gmail.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, Jesse Van Gavere <jesse.vangavere@scioteq.com>
Subject: Re: [PATCH net v2] net: dsa: microchip: KSZ9896 register regmap alignment to 32 bit boundaries
Date: Tue, 10 Dec 2024 14:13:08 +0000 [thread overview]
Message-ID: <20241210141308.GE4202@kernel.org> (raw)
In-Reply-To: <20241207225906.1047985-1-jesse.vangavere@scioteq.com>
On Sat, Dec 07, 2024 at 11:59:06PM +0100, Jesse Van Gavere wrote:
> Commit 8d7ae22ae9f8 ("net: dsa: microchip: KSZ9477 register regmap alignment
> to 32 bit boundaries") fixed an issue whereby regmap_reg_range did not allow
> writes as 32 bit words to KSZ9477 PHY registers, this fix for KSZ9896 is
> adapted from there as the same errata is present in KSZ9896C as
> "Module 5: Certain PHY registers must be written as pairs instead of singly"
> the explanation below is likewise taken from this commit.
>
> Fixes: 5c844d57aa78 ("net: dsa: microchip: fix writes to phy registers >= 0x10")
Hi Jesse,
Sorry to nit-pick but the Fixes tag should be placed along with other tags
at the bottom of the commit description. In this case exactly
above your Signed-off-by line - no blank line in between.
>
> The commit provided code
> to apply "Module 6: Certain PHY registers must be written as pairs instead
> of singly" errata for KSZ9477 as this chip for certain PHY registers
> (0xN120 to 0xN13F, N=1,2,3,4,5) must be accessed as 32 bit words instead
> of 16 or 8 bit access.
> Otherwise, adjacent registers (no matter if reserved or not) are
> overwritten with 0x0.
>
> Without this patch some registers (e.g. 0x113c or 0x1134) required for 32
> bit access are out of valid regmap ranges.
>
> As a result, following error is observed and KSZ9896 is not properly
> configured:
>
> ksz-switch spi1.0: can't rmw 32bit reg 0x113c: -EIO
> ksz-switch spi1.0: can't rmw 32bit reg 0x1134: -EIO
> ksz-switch spi1.0 lan1 (uninitialized): failed to connect to PHY: -EIO
> ksz-switch spi1.0 lan1 (uninitialized): error -5 setting up PHY for tree 0, switch 0, port 0
>
> The solution is to modify regmap_reg_range to allow accesses with 4 bytes
> boundaries.
>
> Signed-off-by: Jesse Van Gavere <jesse.vangavere@scioteq.com>
...
next prev parent reply other threads:[~2024-12-10 14:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-07 22:59 [PATCH net v2] net: dsa: microchip: KSZ9896 register regmap alignment to 32 bit boundaries Jesse Van Gavere
2024-12-10 14:13 ` Simon Horman [this message]
2024-12-10 14:28 ` Jesse Van Gavere
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=20241210141308.GE4202@kernel.org \
--to=horms@kernel.org \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jesse.vangavere@scioteq.com \
--cc=jesseevg@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.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.