All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: phy: ncsi: reslove the unaligned access issue
@ 2024-02-05  8:13 Jacky Chou
  2024-03-28 15:08 ` Tom Rini
  0 siblings, 1 reply; 3+ messages in thread
From: Jacky Chou @ 2024-02-05  8:13 UTC (permalink / raw)
  To: joe.hershberger, rfried.dev, trini, michal.simek,
	marek.vasut+renesas, u-boot
  Cc: BMC-SW

From the ethernet header is not on aligned, because the length
of the ethernet header is 14 bytes.
Therefore, unaligned access must be done here.

Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
---
 drivers/net/phy/ncsi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/phy/ncsi.c b/drivers/net/phy/ncsi.c
index eb3fd65bb4..04617b7840 100644
--- a/drivers/net/phy/ncsi.c
+++ b/drivers/net/phy/ncsi.c
@@ -286,11 +286,11 @@ static void ncsi_rsp_gc(struct ncsi_rsp_pkt *pkt)
 	}
 
 	c = &ncsi_priv->packages[np].channels[nc];
-	c->cap_generic = ntohl(gc->cap) & NCSI_CAP_GENERIC_MASK;
-	c->cap_bc = ntohl(gc->bc_cap) & NCSI_CAP_BC_MASK;
-	c->cap_mc = ntohl(gc->mc_cap) & NCSI_CAP_MC_MASK;
-	c->cap_aen = ntohl(gc->aen_cap) & NCSI_CAP_AEN_MASK;
-	c->cap_vlan = ntohl(gc->vlan_mode) & NCSI_CAP_VLAN_MASK;
+	c->cap_generic = get_unaligned_be32(&gc->cap) & NCSI_CAP_GENERIC_MASK;
+	c->cap_bc = get_unaligned_be32(&gc->bc_cap) & NCSI_CAP_BC_MASK;
+	c->cap_mc = get_unaligned_be32(&gc->mc_cap) & NCSI_CAP_MC_MASK;
+	c->cap_aen = get_unaligned_be32(&gc->aen_cap) & NCSI_CAP_AEN_MASK;
+	c->cap_vlan = gc->vlan_mode & NCSI_CAP_VLAN_MASK;
 
 	/* End of probe for this channel */
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: phy: ncsi: reslove the unaligned access issue
  2024-02-05  8:13 [PATCH] net: phy: ncsi: reslove the unaligned access issue Jacky Chou
@ 2024-03-28 15:08 ` Tom Rini
  2024-03-28 15:57   ` Marek Vasut
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Rini @ 2024-03-28 15:08 UTC (permalink / raw)
  To: Jacky Chou
  Cc: joe.hershberger, rfried.dev, michal.simek, marek.vasut+renesas,
	u-boot, BMC-SW

[-- Attachment #1: Type: text/plain, Size: 326 bytes --]

On Mon, Feb 05, 2024 at 04:13:23PM +0800, Jacky Chou wrote:

> From the ethernet header is not on aligned, because the length
> of the ethernet header is 14 bytes.
> Therefore, unaligned access must be done here.
> 
> Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>

Applied to u-boot/next, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: phy: ncsi: reslove the unaligned access issue
  2024-03-28 15:08 ` Tom Rini
@ 2024-03-28 15:57   ` Marek Vasut
  0 siblings, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2024-03-28 15:57 UTC (permalink / raw)
  To: Tom Rini, Jacky Chou
  Cc: joe.hershberger, rfried.dev, michal.simek, marek.vasut+renesas,
	u-boot, BMC-SW

On 3/28/24 4:08 PM, Tom Rini wrote:
> On Mon, Feb 05, 2024 at 04:13:23PM +0800, Jacky Chou wrote:
> 
>>  From the ethernet header is not on aligned, because the length
>> of the ethernet header is 14 bytes.
>> Therefore, unaligned access must be done here.
>>
>> Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
> 
> Applied to u-boot/next, thanks!

Typo in subject, reslove->resolve .

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-28 15:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-05  8:13 [PATCH] net: phy: ncsi: reslove the unaligned access issue Jacky Chou
2024-03-28 15:08 ` Tom Rini
2024-03-28 15:57   ` Marek Vasut

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.