[PATCH v3 3/3] net: emaclite: fix handling for IP packets with specific lengths

2022-09-27 Thread samuel . obuch
From: Samuel Obuch The maximum length is capped similarly to the emaclite_send function. Avoid integer underflow for values of ip->ip_len < 30, the minimum length of an IP packet is 21 bytes. Signed-off-by: Samuel Obuch --- drivers/net/xilinx_emaclite.c | 4 +++- 1 file changed, 3 inse

[PATCH v3 1/3] net: emaclite: enable for more architectures

2022-09-27 Thread samuel . obuch
From: Samuel Obuch Function ioremap_nocache seems to be defined only for MIPS and Microblaze architectures. Therefore, the function call in the emaclite driver causes this driver to be unusable with other architectures, for example RISC-V. Use ioremap function instead of ioremap_nocache

[PATCH v3 2/3] net: emaclite: fix xemaclite_alignedread/write functions

2022-09-27 Thread samuel . obuch
From: Samuel Obuch Use __raw_read* and __raw_write* functions to ensure read/write is passed to the memory-mapped regions, as non-volatile accesses may get optimised out. Signed-off-by: Samuel Obuch --- drivers/net/xilinx_emaclite.c | 9 - 1 file changed, 4 insertions(+), 5 deletions

[PATCH v2 3/3] net: emaclite: fix handling for IP packets with specific lengths

2022-09-23 Thread samuel . obuch
From: Samuel Obuch The maximum length is capped similarly to the emaclite_send function. Avoid integer underflow for values of ip->ip_len < 30, the minimum length of an IP packet is 21 bytes. Signed-off-by: Samuel Obuch --- drivers/net/xilinx_emaclite.c | 4 +++- 1 file changed, 3 inse

[PATCH v2 2/3] net: emaclite: fix xemaclite_alignedread/write functions

2022-09-23 Thread samuel . obuch
From: Samuel Obuch Use __raw_read* and __raw_write* functions to ensure read/write is passed to the memory-mapped regions, as non-volatile accesses may get optimised out. Signed-off-by: Samuel Obuch --- drivers/net/xilinx_emaclite.c | 9 - 1 file changed, 4 insertions(+), 5 deletions

[PATCH v2 1/3] net: emaclite: fix broken build

2022-09-23 Thread samuel . obuch
From: Samuel Obuch Function ioremap_nocache seems to be defined only for mips and microblaze architectures. Therefore, the function call in the emaclite driver causes this driver to be unusable with other architectures, for example riscv. v2: Use ioremap function instead of ioremap_nocache

Re: [PATCH 1/3] net: emaclite: fix broken build

2022-09-23 Thread Samuel Obuch
Hi, using linux/io.h and ioremap works well for us, thanks. I will update the patch. S On Mon, Aug 8, 2022 at 9:44 AM Michal Simek wrote: > Hi, > > On 8/8/22 09:35, Michal Simek wrote: > > > > > > On 8/6/22 19:31, Ramon Fried wrote: > >> On Wed, Jul 13, 2

Re: [PATCH 2/3] net: emaclite: fix xemaclite_alignedread/write functions

2022-09-23 Thread Samuel Obuch
on, Aug 8, 2022 at 10:05 AM Michal Simek > wrote: > >> > >> > >> > >> On 8/6/22 19:33, Ramon Fried wrote: > >>> On Wed, Jul 13, 2022 at 5:02 PM Samuel Obuch > wrote: > >>>> > >>>> Use __raw_read* and __raw_w

[PATCH 3/3] net: emaclite: fix handling for IP packets with specific lengths

2022-07-13 Thread Samuel Obuch
The maximum length is capped similarly to the emaclite_send function. Avoid integer underflow for values of ip->ip_len < 30, the minimum length of an IP packet is 21 bytes. Signed-off-by: Samuel Obuch --- drivers/net/xilinx_emaclite.c | 4 +++- 1 file changed, 3 insertions(+), 1 de

[PATCH 2/3] net: emaclite: fix xemaclite_alignedread/write functions

2022-07-13 Thread Samuel Obuch
Use __raw_read* and __raw_write* functions to ensure read/write is passed to the memory-mapped regions, as non-volatile accesses may get optimised out. Signed-off-by: Samuel Obuch --- drivers/net/xilinx_emaclite.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git

[PATCH 1/3] net: emaclite: fix broken build

2022-07-13 Thread Samuel Obuch
Function ioremap_nocache seems to be defined only for mips and microblaze architectures. Therefore, the function call in the emaclite driver causes this driver to be unusable with other architectures, for example riscv. Signed-off-by: Samuel Obuch --- drivers/net/xilinx_emaclite.c | 4 1

net: emaclite: Fixes, enable driver for other archs

2022-07-13 Thread Samuel Obuch
These patches solve a few issues with the driver observed on a RISC-V platform.