From: Sasha Levin <sashal@kernel.org> To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>, Jakub Kicinski <kuba@kernel.org>, Sasha Levin <sashal@kernel.org>, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH AUTOSEL 4.19 05/16] ethernet: ucc_geth: fix definition and size of ucc_geth_tx_global_pram Date: Tue, 12 Jan 2021 07:57:14 -0500 [thread overview] Message-ID: <20210112125725.71014-5-sashal@kernel.org> (raw) In-Reply-To: <20210112125725.71014-1-sashal@kernel.org> From: Rasmus Villemoes <rasmus.villemoes@prevas.dk> [ Upstream commit 887078de2a23689e29d6fa1b75d7cbc544c280be ] Table 8-53 in the QUICC Engine Reference manual shows definitions of fields up to a size of 192 bytes, not just 128. But in table 8-111, one does find the text Base Address of the Global Transmitter Parameter RAM Page. [...] The user needs to allocate 128 bytes for this page. The address must be aligned to the page size. I've checked both rev. 7 (11/2015) and rev. 9 (05/2018) of the manual; they both have this inconsistency (and the table numbers are the same). Adding a bit of debug printing, on my board the struct ucc_geth_tx_global_pram is allocated at offset 0x880, while the (opaque) ucc_geth_thread_data_tx gets allocated immediately afterwards, at 0x900. So whatever the engine writes into the thread data overlaps with the tail of the global tx pram (and devmem says that something does get written during a simple ping). I haven't observed any failure that could be attributed to this, but it seems to be the kind of thing that would be extremely hard to debug. So extend the struct definition so that we do allocate 192 bytes. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> --- drivers/net/ethernet/freescale/ucc_geth.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.h b/drivers/net/ethernet/freescale/ucc_geth.h index 5da19b440a6a8..bf25e49d4fe34 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.h +++ b/drivers/net/ethernet/freescale/ucc_geth.h @@ -580,7 +580,14 @@ struct ucc_geth_tx_global_pram { u32 vtagtable[0x8]; /* 8 4-byte VLAN tags */ u32 tqptr; /* a base pointer to the Tx Queues Memory Region */ - u8 res2[0x80 - 0x74]; + u8 res2[0x78 - 0x74]; + u64 snums_en; + u32 l2l3baseptr; /* top byte consists of a few other bit fields */ + + u16 mtu[8]; + u8 res3[0xa8 - 0x94]; + u32 wrrtablebase; /* top byte is reserved */ + u8 res4[0xc0 - 0xac]; } __packed; /* structure representing Extended Filtering Global Parameters in PRAM */ -- 2.27.0
WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sashal@kernel.org> To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sasha Levin <sashal@kernel.org>, Jakub Kicinski <kuba@kernel.org>, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Rasmus Villemoes <rasmus.villemoes@prevas.dk> Subject: [PATCH AUTOSEL 4.19 05/16] ethernet: ucc_geth: fix definition and size of ucc_geth_tx_global_pram Date: Tue, 12 Jan 2021 07:57:14 -0500 [thread overview] Message-ID: <20210112125725.71014-5-sashal@kernel.org> (raw) In-Reply-To: <20210112125725.71014-1-sashal@kernel.org> From: Rasmus Villemoes <rasmus.villemoes@prevas.dk> [ Upstream commit 887078de2a23689e29d6fa1b75d7cbc544c280be ] Table 8-53 in the QUICC Engine Reference manual shows definitions of fields up to a size of 192 bytes, not just 128. But in table 8-111, one does find the text Base Address of the Global Transmitter Parameter RAM Page. [...] The user needs to allocate 128 bytes for this page. The address must be aligned to the page size. I've checked both rev. 7 (11/2015) and rev. 9 (05/2018) of the manual; they both have this inconsistency (and the table numbers are the same). Adding a bit of debug printing, on my board the struct ucc_geth_tx_global_pram is allocated at offset 0x880, while the (opaque) ucc_geth_thread_data_tx gets allocated immediately afterwards, at 0x900. So whatever the engine writes into the thread data overlaps with the tail of the global tx pram (and devmem says that something does get written during a simple ping). I haven't observed any failure that could be attributed to this, but it seems to be the kind of thing that would be extremely hard to debug. So extend the struct definition so that we do allocate 192 bytes. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> --- drivers/net/ethernet/freescale/ucc_geth.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.h b/drivers/net/ethernet/freescale/ucc_geth.h index 5da19b440a6a8..bf25e49d4fe34 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.h +++ b/drivers/net/ethernet/freescale/ucc_geth.h @@ -580,7 +580,14 @@ struct ucc_geth_tx_global_pram { u32 vtagtable[0x8]; /* 8 4-byte VLAN tags */ u32 tqptr; /* a base pointer to the Tx Queues Memory Region */ - u8 res2[0x80 - 0x74]; + u8 res2[0x78 - 0x74]; + u64 snums_en; + u32 l2l3baseptr; /* top byte consists of a few other bit fields */ + + u16 mtu[8]; + u8 res3[0xa8 - 0x94]; + u32 wrrtablebase; /* top byte is reserved */ + u8 res4[0xc0 - 0xac]; } __packed; /* structure representing Extended Filtering Global Parameters in PRAM */ -- 2.27.0
next prev parent reply other threads:[~2021-01-12 13:08 UTC|newest] Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-01-12 12:57 [PATCH AUTOSEL 4.19 01/16] ARC: build: remove non-existing bootpImage from KBUILD_IMAGE Sasha Levin 2021-01-12 12:57 ` Sasha Levin 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 02/16] ARC: build: add uImage.lzma to the top-level target Sasha Levin 2021-01-12 12:57 ` Sasha Levin 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 03/16] ARC: build: add boot_targets to PHONY Sasha Levin 2021-01-12 12:57 ` Sasha Levin 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 04/16] btrfs: fix transaction leak and crash after RO remount caused by qgroup rescan Sasha Levin 2021-01-12 12:57 ` Sasha Levin [this message] 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 05/16] ethernet: ucc_geth: fix definition and size of ucc_geth_tx_global_pram Sasha Levin 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 06/16] qede: fix offload for IPIP tunnel packets Sasha Levin 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 07/16] CDC-NCM: remove "connected" log message Sasha Levin 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 08/16] dmaengine: stm32-mdma: fix STM32_MDMA_VERY_HIGH_PRIORITY value Sasha Levin 2021-01-12 12:57 ` Sasha Levin 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 09/16] net: usb: qmi_wwan: add Quectel EM160R-GL Sasha Levin 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 10/16] bfq: Fix computation of shallow depth Sasha Levin 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 11/16] arch/arc: add copy_user_page() to <asm/page.h> to fix build error on ARC Sasha Levin 2021-01-12 12:57 ` Sasha Levin 2021-01-12 12:57 ` Sasha Levin 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 12/16] misdn: dsp: select CONFIG_BITREVERSE Sasha Levin 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 13/16] net: ethernet: fs_enet: Add missing MODULE_LICENSE Sasha Levin 2021-01-12 12:57 ` Sasha Levin 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 14/16] ACPI: scan: add stub acpi_create_platform_device() for !CONFIG_ACPI Sasha Levin 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 15/16] drm/msm: Call msm_init_vram before binding the gpu Sasha Levin 2021-01-12 12:57 ` Sasha Levin 2021-01-12 12:57 ` [PATCH AUTOSEL 4.19 16/16] ARM: picoxcell: fix missing interrupt-parent properties Sasha Levin 2021-01-12 12:57 ` Sasha Levin
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=20210112125725.71014-5-sashal@kernel.org \ --to=sashal@kernel.org \ --cc=kuba@kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linuxppc-dev@lists.ozlabs.org \ --cc=netdev@vger.kernel.org \ --cc=rasmus.villemoes@prevas.dk \ --cc=stable@vger.kernel.org \ /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: linkBe 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.