Re: [PATCH v3 RESEND 4/6] bitmap: Introduce bitmap_off()

2024-02-12 Thread Rasmus Villemoes
On 12/02/2024 08.56, Herve Codina wrote: > The bitmap_onto() function translates one bitmap relative to another but > no function are present to perform the reverse translation. > > Introduce bitmap_off() to fill this hole. > > Signed-off-by: Herve Codina > --- > include/linux/bitmap.h | 3

Re: [PATCH 2/6] treewide: remove using list iterator after loop body as a ptr

2022-03-02 Thread Rasmus Villemoes
On 02/03/2022 00.55, Linus Torvalds wrote: > On Tue, Mar 1, 2022 at 3:19 PM David Laight wrote: >> > With the "don't use iterator outside the loop" approach, the exact > same code works in both the old world order and the new world order, > and you don't have the semantic confusion. And *if* you

Re: [PATCH/RFC] of: Shrink struct of_device_id

2021-11-10 Thread Rasmus Villemoes
On 10/11/2021 17.23, Geert Uytterhoeven wrote: > Currently struct of_device_id is 196 (32-bit) or 200 (64-bit) bytes > large. It contains fixed-size strings for a name, a type, and a > compatible value, but the first two are barely used. > OF device ID tables contain multiple entries, plus an

Re: [PATCH 1/2] mm: Fix struct page layout on 32-bit systems

2021-04-20 Thread Rasmus Villemoes
On 17/04/2021 01.07, Matthew Wilcox (Oracle) wrote: > 32-bit architectures which expect 8-byte alignment for 8-byte integers > and need 64-bit DMA addresses (arc, arm, mips, ppc) had their struct > page inadvertently expanded in 2019. When the dma_addr_t was added, > it forced the alignment of

Re: [PATCH v1 1/1] kernel.h: Split out panic and oops helpers

2021-04-08 Thread Rasmus Villemoes
On 06/04/2021 15.31, Andy Shevchenko wrote: > kernel.h is being used as a dump for all kinds of stuff for a long time. > Here is the attempt to start cleaning it up by splitting out panic and > oops helpers. Yay. Acked-by: Rasmus Villemoes > At the same time convert users in he

Re: [PATCH] powerpc/vdso32: Add missing _restgpr_31_x to fix build failure

2021-03-15 Thread Rasmus Villemoes
On 12/03/2021 03.29, Segher Boessenkool wrote: > Hi! > > On Tue, Mar 09, 2021 at 06:19:30AM +, Christophe Leroy wrote: >> With some defconfig including CONFIG_CC_OPTIMIZE_FOR_SIZE, >> (for instance mvme5100_defconfig and ps3_defconfig), gcc 5 >> generates a call to _restgpr_31_x. > >> I

Re: [PATCH] ethernet: ucc_geth: Use kmemdup instead of kmalloc and memcpy

2021-03-09 Thread Rasmus Villemoes
p(_primary_info, sizeof(*ug_info), GFP_KERNEL); > if (ug_info == NULL) > return -ENOMEM; > - memcpy(ug_info, _primary_info, sizeof(*ug_info)); > > ug_info->uf_info.ucc_num = ucc_num; > > Ah, yes, of course, I should have used that. Acked-by: Rasmus Villemoes

Re: [PATCH 00/20] ethernet: ucc_geth: assorted fixes and simplifications

2020-12-09 Thread Rasmus Villemoes
On 05/12/2020 22.27, Jakub Kicinski wrote: > On Sat, 5 Dec 2020 22:11:39 +0100 Rasmus Villemoes wrote: >>> Looks like a nice clean up on a quick look. >>> >>> Please separate patches 1 and 11 (which are the two bug fixes I see) >> >> I think patch 2

Re: [PATCH 14/20] ethernet: ucc_geth: don't statically allocate eight ucc_geth_info

2020-12-08 Thread Rasmus Villemoes
On 08/12/2020 16.13, Christophe Leroy wrote: > > > Le 05/12/2020 à 20:17, Rasmus Villemoes a écrit : >> @@ -3714,25 +3712,23 @@ static int ucc_geth_probe(struct >> platform_device* ofdev) >>   if ((ucc_num < 0) || (ucc_num > 7)) >>   return -EN

Re: [PATCH 18/20] ethernet: ucc_geth: add helper to replace repeated switch statements

2020-12-08 Thread Rasmus Villemoes
On 08/12/2020 16.21, Christophe Leroy wrote: > > > Le 05/12/2020 à 20:17, Rasmus Villemoes a écrit : >> The translation from the ucc_geth_num_of_threads enum value to the >> actual count can be written somewhat more compactly with a small >> lookup table, allowing us

Re: [PATCH 02/20] ethernet: ucc_geth: fix definition and size of ucc_geth_tx_global_pram

2020-12-08 Thread Rasmus Villemoes
On 08/12/2020 20.14, Li Yang wrote: > On Sat, Dec 5, 2020 at 1:21 PM Rasmus Villemoes > wrote: >> >> 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

Re: [PATCH 00/20] ethernet: ucc_geth: assorted fixes and simplifications

2020-12-08 Thread Rasmus Villemoes
On 08/12/2020 04.07, Qiang Zhao wrote: > On 06/12/2020 05:12, Rasmus Villemoes wrote: > >> I think patch 2 is a bug fix as well, but I'd like someone from NXP to >> comment. > > It 's ok for me. I was hoping for something a bit more than that. Can you please go check

[PATCH 15/20] ethernet: ucc_geth: use UCC_GETH_{RX, TX}_BD_RING_ALIGNMENT macros directly

2020-12-05 Thread Rasmus Villemoes
These macros both have the value 32, there's no point first initializing align to a lower value. If anything, one could throw in a BUILD_BUG_ON(UCC_GETH_TX_BD_RING_ALIGNMENT < 4), but it's not worth it - lots of code depends on named constants having sensible values. Signed-off-by: Ras

[PATCH 12/20] ethernet: ucc_geth: factor out parsing of {rx, tx}-clock{, -name} properties

2020-12-05 Thread Rasmus Villemoes
Reduce the code duplication a bit by moving the parsing of rx-clock-name and the fallback handling to a helper function. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 79 ++- 1 file changed, 35 insertions(+), 44 deletions(-) diff --git

[PATCH 10/20] ethernet: ucc_geth: remove {rx, tx}_glbl_pram_offset from struct ucc_geth_private

2020-12-05 Thread Rasmus Villemoes
), and fixes the problems with using IS_ERR_VALUE() on a u32 as explained in commit 800cd6fb76f0 ("soc: fsl: qe: change return type of cpm_muram_alloc() to s32"). Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 21 + drivers/net/ethernet

Re: [PATCH 11/20] ethernet: ucc_geth: fix use-after-free in ucc_geth_remove()

2020-12-05 Thread Rasmus Villemoes
> I only noticed because I needed to add a free of the ug_info in a later > patch. Where, ironically, I add a use-after-free bug by freeing ug_info before the ucc_geth_memclean() call. :facepalm:

Re: [PATCH 00/20] ethernet: ucc_geth: assorted fixes and simplifications

2020-12-05 Thread Rasmus Villemoes
On 05/12/2020 22.27, Jakub Kicinski wrote: > On Sat, 5 Dec 2020 22:11:39 +0100 Rasmus Villemoes wrote: >>> rebase (retest) and post them against the net tree: >>> >>> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/ >> >> So I thought th

Re: [PATCH 11/20] ethernet: ucc_geth: fix use-after-free in ucc_geth_remove()

2020-12-05 Thread Rasmus Villemoes
On 05/12/2020 22.19, Jakub Kicinski wrote: > On Sat, 5 Dec 2020 22:04:28 +0100 Rasmus Villemoes wrote: >> On 05/12/2020 21.48, Jakub Kicinski wrote: >>> On Sat, 5 Dec 2020 20:17:34 +0100 Rasmus Villemoes wrote: >>>> - unregister_netdev(dev); >>>> - f

Re: [PATCH 00/20] ethernet: ucc_geth: assorted fixes and simplifications

2020-12-05 Thread Rasmus Villemoes
On 05/12/2020 21.53, Jakub Kicinski wrote: > On Sat, 5 Dec 2020 20:17:23 +0100 Rasmus Villemoes wrote: >> While trying to figure out how to allow bumping the MTU with the >> ucc_geth driver, I fell into a rabbit hole and stumbled on a whole >> bunch of issues of vary

Re: [PATCH 11/20] ethernet: ucc_geth: fix use-after-free in ucc_geth_remove()

2020-12-05 Thread Rasmus Villemoes
On 05/12/2020 21.48, Jakub Kicinski wrote: > On Sat, 5 Dec 2020 20:17:34 +0100 Rasmus Villemoes wrote: >> -unregister_netdev(dev); >> -free_netdev(dev); >> ucc_geth_memclean(ugeth); >> if (of_phy_is_fixed_link(np)) >>

[PATCH 20/20] ethernet: ucc_geth: simplify rx/tx allocations

2020-12-05 Thread Rasmus Villemoes
ry elegant and certainly makes a reader of the code pause for a while. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 50 --- drivers/net/ethernet/freescale/ucc_geth.h | 2 - 2 files changed, 17 insertions(+), 35 deletions(-) diff --git a/drivers/ne

[PATCH 19/20] ethernet: ucc_geth: inform the compiler that numQueues is always 1

2020-12-05 Thread Rasmus Villemoes
that are not really loops by creating static inline helpers. If and when the numQueuesTx/numQueuesRx fields are re-introduced, it suffices to update those helper to return the appropriate field. This cuts the .text segment of ucc_geth.o by 8%. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet

[PATCH 18/20] ethernet: ucc_geth: add helper to replace repeated switch statements

2020-12-05 Thread Rasmus Villemoes
The translation from the ucc_geth_num_of_threads enum value to the actual count can be written somewhat more compactly with a small lookup table, allowing us to replace the four switch statements. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 100

[PATCH 17/20] ethernet: ucc_geth: replace kmalloc_array()+for loop by kcalloc()

2020-12-05 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index c9f619908561..3aebea191b52 100644

[PATCH 16/20] ethernet: ucc_geth: remove bd_mem_part and all associated code

2020-12-05 Thread Rasmus Villemoes
of dead code, this is also motivated by wanting to clean up the "store result from kmalloc() in a u32" mess. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 106 ++ include/soc/fsl/qe/qe.h | 6 -- include/

[PATCH 14/20] ethernet: ucc_geth: don't statically allocate eight ucc_geth_info

2020-12-05 Thread Rasmus Villemoes
k was dead code, as the address of some static array element can obviously never be NULL. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 32 +-- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc

[PATCH 13/20] ethernet: ucc_geth: constify ugeth_primary_info

2020-12-05 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 700eafef4921..a06744d8b4af 100644 --- a/drivers/net

[PATCH 11/20] ethernet: ucc_geth: fix use-after-free in ucc_geth_remove()

2020-12-05 Thread Rasmus Villemoes
ugeth is the netdiv_priv() part of the netdevice. Accessing the memory pointed to by ugeth (such as done by ucc_geth_memclean() and the two of_node_puts) after free_netdev() is thus use-after-free. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 4 ++-- 1 file

[PATCH 09/20] ethernet: ucc_geth: replace kmalloc+memset by kzalloc

2020-12-05 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index f854ff90f238..e1574c14b7e5 100644 --- a/drivers/net

[PATCH 03/20] ethernet: ucc_geth: remove unused read of temoder field

2020-12-05 Thread Rasmus Villemoes
In theory, such a read-after-write might be required by the hardware, but nothing in the data sheet suggests that to be the case. The name test also suggests that it's some debug leftover. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 3 --- 1 file changed, 3

[PATCH 08/20] ethernet: ucc_geth: remove unnecessary memset_io() calls

2020-12-05 Thread Rasmus Villemoes
These buffers have all just been handed out from qe_muram_alloc(), aka cpm_muram_alloc(), and the helper cpm_muram_alloc_common() already does memset_io(cpm_muram_addr(start), 0, size); Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 19

[PATCH 07/20] ethernet: ucc_geth: use qe_muram_free_addr()

2020-12-05 Thread Rasmus Villemoes
This removes the explicit NULL checks, and allows us to stop storing at least some of the _offset values separately. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 77 ++- 1 file changed, 33 insertions(+), 44 deletions(-) diff --git

[PATCH 06/20] soc: fsl: qe: add cpm_muram_free_addr() helper

2020-12-05 Thread Rasmus Villemoes
Add a helper that takes a virtual address rather than the muram offset. This will be used in a couple of places to avoid having to store both the offset and the virtual address, as well as removing NULL checks from the callers. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_common.c

[PATCH 04/20] soc: fsl: qe: make cpm_muram_offset take a const void* argument

2020-12-05 Thread Rasmus Villemoes
Allow passing const-qualified pointers without requiring a cast in the caller. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_common.c | 2 +- include/soc/fsl/qe/qe.h| 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_common.c b

[PATCH 05/20] soc: fsl: qe: store muram_vbase as a void pointer instead of u8

2020-12-05 Thread Rasmus Villemoes
-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_common.c index 0fbdc965c4cb..303cc2f5eb4a 100644 --- a/drivers/soc/fsl/qe/qe_common.c +++ b/drivers/soc/fsl/qe

[PATCH 00/20] ethernet: ucc_geth: assorted fixes and simplifications

2020-12-05 Thread Rasmus Villemoes
, someone in NXP should check how the hardware actually works and make an updated reference manual available. Rasmus Villemoes (20): ethernet: ucc_geth: set dev->max_mtu to 1518 ethernet: ucc_geth: fix definition and size of ucc_geth_tx_global_pram ethernet: ucc_geth: remove unused read of temo

[PATCH 02/20] ethernet: ucc_geth: fix definition and size of ucc_geth_tx_global_pram

2020-12-05 Thread Rasmus Villemoes
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 --- drivers/net/ethernet/freescale/ucc_geth.h | 9 - 1 file changed, 8 insertions(+), 1 deletion

[PATCH 01/20] ethernet: ucc_geth: set dev->max_mtu to 1518

2020-12-05 Thread Rasmus Villemoes
mir Oltean Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/ucc_geth.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index 714b501be7d0..380c1f09adaf 100644 --- a/drivers/net/ethernet

Re: [PATCH 0/6] Fix sparse warnings for common qe library code

2020-03-16 Thread Rasmus Villemoes
e warnings for qe_ic.c > soc: fsl: qe: fix sparse warnings for ucc_fast.c > soc: fsl: qe: fix sparse warnings for ucc_slow.c Patches 2-5 should not change the generated code, whether LE or BE host, as they merely add sparse annotations (please double-check with objdump that that is indeed

Re: [PATCH 6/6] soc: fsl: qe: fix sparse warnings for ucc_slow.c

2020-03-16 Thread Rasmus Villemoes
On 12/03/2020 23.28, Li Yang wrote: > Fixes the following sparse warnings: > [snip] > > Also removed the unneccessary clearing for kzalloc'ed structure. Please don't mix that in the same patch, do it in a preparatory patch. That makes reviewing much easier. > > /* Get PRAM base */ >

Re: eh_frame confusion

2020-03-03 Thread Rasmus Villemoes
On 02/03/2020 18.32, Naveen N. Rao wrote: > Naveen N. Rao wrote: >> Michael opened a task to look into this recently and I had spent some >> time last week on this. The original commit/discussion adding >> -fno-dwarf2-cfi-asm refers to R_PPC64_REL32 relocations not being >> handled by our module

eh_frame confusion

2020-03-02 Thread Rasmus Villemoes
I'm building a ppc32 kernel, and noticed that after upgrading from gcc-7 to gcc-8 all object files now end up having .eh_frame section. For vmlinux, that's not a problem, because they all get discarded in arch/powerpc/kernel/vmlinux.lds.S . However, they stick around in modules, which doesn't seem

Re: [PATCH AUTOSEL 4.9 003/141] soc: fsl: qe: change return type of cpm_muram_alloc() to s32

2020-02-14 Thread Rasmus Villemoes
On 14/02/2020 17.19, Sasha Levin wrote: > From: Rasmus Villemoes > > [ Upstream commit 800cd6fb76f0ec7711deb72a86c924db1ae42648 ] Hmm. Please note that these two autosel patches were part of a giant 48-patch series. While not all depending on each other, there are definitely some dep

[PATCH] serial: cpm_uart: call cpm_muram_init before registering console

2020-02-13 Thread Rasmus Villemoes
() is safe to call twice (there's an early return if it is already initialized), so keep the call from cpm_init() - in case SERIAL_CPM_CONSOLE=n. Reported-by: Christophe Leroy Fixes: b6231ea2b3c6 (soc: fsl: qe: drop broken lazy call of cpm_muram_init()) Signed-off-by: Rasmus Villemoes --- Christophe

Re: [Regression 5.6-rc1][Bisected b6231ea2b3c6] Powerpc 8xx doesn't boot anymore

2020-02-13 Thread Rasmus Villemoes
On 12/02/2020 15.50, Christophe Leroy wrote: > > > On 02/12/2020 02:24 PM, Christophe Leroy wrote: >> In your commit text you explain that cpm_muram_init() is called via >> subsys_initcall. But console init is done before that, so it cannot work. >> >> Do you have a fix for that ? >> > > The

Re: [Regression 5.6-rc1][Bisected b6231ea2b3c6] Powerpc 8xx doesn't boot anymore

2020-02-12 Thread Rasmus Villemoes
On 12/02/2020 15.24, Christophe Leroy wrote: > Hi Rasmus, > > Kernel 5.6-rc1 silently fails on boot. > > I bisected the problem to commit b6231ea2b3c6 ("soc: fsl: qe: drop > broken lazy call of cpm_muram_init()") > > I get a bad_page_fault() for an access at address 8 in >

Re: vmlinux ELF header sometimes corrupt

2020-01-28 Thread Rasmus Villemoes
On 22/01/2020 18.52, Rasmus Villemoes wrote: > I'm building for a ppc32 (mpc8309) target using Yocto, and I'm hitting a > very hard to debug problem that maybe someone else has encountered. This > doesn't happen always, perhaps 1 in 8 times or something like that. > > The iss

Re: vmlinux ELF header sometimes corrupt

2020-01-24 Thread Rasmus Villemoes
On 24/01/2020 11.50, Michael Ellerman wrote: > Rasmus Villemoes writes: >> I'm building for a ppc32 (mpc8309) target using Yocto, and I'm hitting a >> very hard to debug problem that maybe someone else has encountered. This >> doesn't happen always, perhaps 1 in 8 ti

vmlinux ELF header sometimes corrupt

2020-01-22 Thread Rasmus Villemoes
I'm building for a ppc32 (mpc8309) target using Yocto, and I'm hitting a very hard to debug problem that maybe someone else has encountered. This doesn't happen always, perhaps 1 in 8 times or something like that. The issue is that when the build gets to do "${CROSS}objcopy -O binary ...

Re: [PATCH v6 00/49] QUICC Engine support on ARM, ARM64, PPC64

2019-12-02 Thread Rasmus Villemoes
On 01/12/2019 17.10, Timur Tabi wrote: > On 11/28/19 8:55 AM, Rasmus Villemoes wrote: >> There have been several attempts in the past few years to allow >> building the QUICC engine drivers for platforms other than PPC32. This >> is yet another attempt. >> >&

[PATCH v6 47/49] net: ethernet: freescale: make UCC_GETH explicitly depend on PPC32

2019-11-28 Thread Rasmus Villemoes
and most likely will not be in the future. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/freescale/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig index

[PATCH v6 49/49] soc: fsl: qe: remove PPC32 dependency from CONFIG_QUICC_ENGINE

2019-11-28 Thread Rasmus Villemoes
gned-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qe/Kconfig b/drivers/soc/fsl/qe/Kconfig index cfa4b2939992..357c5800b112 100644 --- a/drivers/soc/fsl/qe/Kconfig +++ b/drivers/soc/fsl/qe/Kconfig @@ -

[PATCH v6 46/49] net/wan/fsl_ucc_hdlc: reject muram offsets above 64K

2019-11-28 Thread Rasmus Villemoes
Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/net/wan/fsl_ucc_hdlc.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c index 8d13586bb774..f029eaa7cfc0 100644 --- a/drivers/net/wan/fsl_ucc_hdlc.c +++ b/drivers

[PATCH v6 48/49] soc: fsl: qe: remove unused #include of asm/irq.h from ucc.c

2019-11-28 Thread Rasmus Villemoes
d test robot Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/ucc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/soc/fsl/qe/ucc.c b/drivers/soc/fsl/qe/ucc.c index da3d7e2dd837..90157acc5ba6 100644 --- a/drivers/soc/fsl/qe/ucc.c +++ b/drivers/soc/fsl/qe/ucc.c @@ -15,7 +15,6 @@ #i

[PATCH v6 44/49] net/wan/fsl_ucc_hdlc: avoid use of IS_ERR_VALUE()

2019-11-28 Thread Rasmus Villemoes
t;ret < 0". Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/net/wan/fsl_ucc_hdlc.c | 10 +- drivers/net/wan/fsl_ucc_hdlc.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc

[PATCH v6 45/49] net/wan/fsl_ucc_hdlc: fix reading of __be16 registers

2019-11-28 Thread Rasmus Villemoes
for now the driver is PPC32-only. But it will soon be allowed to be used on arm and arm64 as well. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/net/wan/fsl_ucc_hdlc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b

[PATCH v6 43/49] soc: fsl: qe: avoid IS_ERR_VALUE in ucc_fast.c

2019-11-28 Thread Rasmus Villemoes
, this avoids treating 0 as "this cannot have been returned from qe_muram_alloc() so don't free it". Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/ucc_fast.c | 15 ++- include/soc/fsl/qe/ucc_fast.h | 4 ++-- 2 files changed, 8 inserti

[PATCH v6 42/49] soc: fsl: qe: drop pointless check in qe_sdma_init()

2019-11-28 Thread Rasmus Villemoes
The sdma member of struct qe_immap is not at offset zero, so even if qe_immr wasn't initialized yet (i.e. NULL), _immr->sdma would not be NULL. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/

[PATCH v6 41/49] soc: fsl: qe: drop use of IS_ERR_VALUE in qe_sdma_init()

2019-11-28 Thread Rasmus Villemoes
Now that qe_muram_alloc() returns s32, adapt qe_sdma_init() and avoid another few IS_ERR_VALUE() uses. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/fsl/qe/qe.c b/drivers

[PATCH v6 40/49] soc: fsl: qe: avoid IS_ERR_VALUE in ucc_slow.c

2019-11-28 Thread Rasmus Villemoes
value). Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/ucc_slow.c | 22 +- include/soc/fsl/qe/ucc_slow.h | 6 +++--- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/soc/fsl/qe/ucc_slow.c b/drivers/soc/fsl/qe/ucc_slow.c

[PATCH v6 39/49] soc: fsl: qe: refactor cpm_muram_alloc_common to prevent BUG on error path

2019-11-28 Thread Rasmus Villemoes
ram_alloc callers allow) change it to a GFP_KERNEL allocation. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_common.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl/qe/qe_c

[PATCH v6 38/49] soc: fsl: qe: drop broken lazy call of cpm_muram_init()

2019-11-28 Thread Rasmus Villemoes
() in arch/powerpc/sysdev/cpm_common.c or, via qe_reset(), from qe_init() in drivers/soc/fsl/qe/qe.c). Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_common.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_common.c b/drivers/soc/fsl

[PATCH v6 37/49] soc: fsl: qe: make cpm_muram_free() ignore a negative offset

2019-11-28 Thread Rasmus Villemoes
This allows one to simplify callers since they can store a negative value as a sentinel to indicate "this was never allocated" (or store the -ENOMEM from an allocation failure) and then call cpm_muram_free() unconditionally. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --

[PATCH v6 36/49] soc: fsl: qe: make cpm_muram_free() return void

2019-11-28 Thread Rasmus Villemoes
Nobody uses the return value from cpm_muram_free, and functions that free resources usually return void. One could imagine a use for a "how much have I allocated" a la ksize(), but knowing how much one had access to after the fact is useless. Reviewed-by: Timur Tabi Signed-off-

[PATCH v6 35/49] soc: fsl: qe: change return type of cpm_muram_alloc() to s32

2019-11-28 Thread Rasmus Villemoes
itionally call cpm_muram_free(). Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_common.c | 29 - include/soc/fsl/qe/qe.h| 16 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/drivers/soc/fsl

[PATCH v6 34/49] serial: ucc_uart: access __be32 field using be32_to_cpu

2019-11-28 Thread Rasmus Villemoes
The buf member of struct qe_bd is a __be32, so to make this work on little-endian hosts, use be32_to_cpu when reading it. Reviewed-by: Timur Tabi Acked-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/tty/serial/ucc_uart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[PATCH v6 33/49] serial: ucc_uart: limit brg-frequency workaround to PPC32

2019-11-28 Thread Rasmus Villemoes
Acked-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/tty/serial/ucc_uart.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index c055abf4c919..9436b93d5cfa 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty

[PATCH v6 32/49] serial: ucc_uart: use of_property_read_u32() in ucc_uart_probe()

2019-11-28 Thread Rasmus Villemoes
For this to work correctly on little-endian hosts, don't access the device-tree properties directly in native endianness, but use the of_property_read_u32() helper. Reviewed-by: Timur Tabi Acked-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/tty/serial/ucc_uart.c | 36

[PATCH v6 31/49] serial: ucc_uart: stub out soft_uart_init for !CONFIG_PPC32

2019-11-28 Thread Rasmus Villemoes
The Soft UART hack is only needed for some PPC-based SOCs. To allow building this driver for non-PPC, guard soft_uart_init() and its helpers by CONFIG_PPC32, and use a no-op soft_uart_init() otherwise. Reviewed-by: Timur Tabi Acked-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers

[PATCH v6 30/49] serial: ucc_uart: factor out soft_uart initialization

2019-11-28 Thread Rasmus Villemoes
-need-soft-uart-and-if-so-handle-the-firmware to a separate function, which we can then easily stub out for non-PPC. Reviewed-by: Timur Tabi Acked-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/tty/serial/ucc_uart.c | 110 ++ 1 file changed, 58 inserti

[PATCH v6 29/49] serial: ucc_uart: replace ppc-specific IO accessors

2019-11-28 Thread Rasmus Villemoes
Some ARM-based SOCs (e.g. LS1021A) also have a QUICC engine. As preparation for allowing this driver to build on ARM, replace the ppc-specific in_be16() etc. by the qe_io* helpers. Done via coccinelle. Reviewed-by: Timur Tabi Acked-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers

[PATCH v6 28/49] serial: ucc_uart: explicitly include soc/fsl/cpm.h

2019-11-28 Thread Rasmus Villemoes
This driver uses #defines from soc/fsl/cpm.h, so instead of relying on some other header pulling that in, do that explicitly. This is preparation for allowing this driver to build on ARM. Reviewed-by: Timur Tabi Acked-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/tty/serial

[PATCH v6 27/49] soc/fsl/qe/qe.h: update include path for cpm.h

2019-11-28 Thread Rasmus Villemoes
asm/cpm.h under arch/powerpc is now just a wrapper for including soc/fsl/cpm.h. In order to make the qe.h header usable on other architectures, use the latter path directly. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- include/soc/fsl/qe/qe.h | 2 +- 1 file changed, 1 insertion

[PATCH v6 26/49] soc: fsl: move cpm.h from powerpc/include/asm to include/soc/fsl

2019-11-28 Thread Rasmus Villemoes
Some drivers, e.g. ucc_uart, need definitions from cpm.h. In order to allow building those drivers for non-ppc based SOCs, move the header to include/soc/fsl. For now, leave a trivial wrapper at the old location so drivers can be updated one by one. Reviewed-by: Timur Tabi Signed-off-by: Rasmus

[PATCH v6 25/49] soc: fsl: qe: qe_io.c: use of_property_read_u32() in par_io_init()

2019-11-28 Thread Rasmus Villemoes
This is necessary for this to work on little-endian hosts. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_io.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_io.c b/drivers/soc/fsl/qe/qe_io.c index

[PATCH v6 24/49] soc: fsl: qe: qe_io.c: access device tree property using be32_to_cpu

2019-11-28 Thread Rasmus Villemoes
We need to apply be32_to_cpu to make this work correctly on little-endian hosts. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_io.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_io.c b/drivers/soc

[PATCH v6 23/49] soc: fsl: qe: qe_io.c: don't open-code of_parse_phandle()

2019-11-28 Thread Rasmus Villemoes
Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_io.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_io.c b/drivers/soc/fsl/qe/qe_io.c index f6b10f38b2f4..99aeb01586bd 100644 --- a/drivers/soc/fsl/qe/qe_io.c

[PATCH v6 22/49] soc: fsl: qe: qe.c: use of_property_read_* helpers

2019-11-28 Thread Rasmus Villemoes
. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 33 - 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c index a4763282ea68..ec511840db3c 100644 --- a/drivers/soc/fsl/qe

[PATCH v6 21/49] soc: fsl: qe: merge qe_ic.h headers into qe_ic.c

2019-11-28 Thread Rasmus Villemoes
The public qe_ic.h header is no longer included by anything but qe_ic.c. Merge both headers into qe_ic.c, and drop the unused constants. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 52 +++- drivers/soc/fsl/qe/qe_ic.h | 99

[PATCH v6 18/49] soc: fsl: qe: don't use NO_IRQ in qe_ic.c

2019-11-28 Thread Rasmus Villemoes
for allowing this driver to build on other architectures, drop all references to NO_IRQ. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_ic.c b

[PATCH v6 19/49] soc: fsl: qe: make qe_ic_get_{low,high}_irq static

2019-11-28 Thread Rasmus Villemoes
These are only called from within qe_ic.c, so make them static. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 4 ++-- include/soc/fsl/qe/qe_ic.h | 10 -- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/soc/fsl/qe

[PATCH v6 17/49] soc: fsl: qe: remove unused qe_ic_set_* functions

2019-11-28 Thread Rasmus Villemoes
, but for future reference please note that I believe qe_ic_set_priority is buggy: The "priority < 4" should be "priority <= 4", and in the else branch 24 should be replaced by 28, at least if I'm reading the data sheet right. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoe

[PATCH v6 20/49] soc: fsl: qe: simplify qe_ic_init()

2019-11-28 Thread Rasmus Villemoes
the bootloader has played funny games. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 27 --- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_ic.c b/drivers/soc/fsl/qe/qe_ic.c index 23b457e884d8

[PATCH v6 16/49] soc: fsl: qe: rename qe_ic_cascade_low_mpic -> qe_ic_cascade_low

2019-11-28 Thread Rasmus Villemoes
The qe_ic_cascade_{low,high}_mpic functions are now used as handlers both when the interrupt parent is mpic as well as ipic, so remove the _mpic suffix. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 8 1 file changed, 4 insertions(+), 4

[PATCH v6 15/49] soc: fsl: qe: move qe_ic_cascade_* functions to qe_ic.c

2019-11-28 Thread Rasmus Villemoes
make them local to that file. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 42 ++ include/soc/fsl/qe/qe_ic.h | 42 -- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git

[PATCH v6 14/49] powerpc/85xx: remove mostly pointless mpc85xx_qe_init()

2019-11-28 Thread Rasmus Villemoes
-by: Scott Wood Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- arch/powerpc/platforms/85xx/common.c | 23 --- arch/powerpc/platforms/85xx/corenet_generic.c | 2 -- arch/powerpc/platforms/85xx/mpc85xx.h | 2 -- arch/powerpc/platforms/85xx

[PATCH v6 13/49] powerpc/83xx: remove mpc83xx_ipic_and_qe_init_IRQ

2019-11-28 Thread Rasmus Villemoes
This is now exactly the same as mpc83xx_ipic_init_IRQ, so just use that directly. Acked-by: Scott Wood Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- arch/powerpc/platforms/83xx/km83xx.c | 2 +- arch/powerpc/platforms/83xx/misc.c| 7 --- arch/powerpc/platforms

[PATCH v6 12/49] soc: fsl: qe: move calls of qe_ic_init out of arch/powerpc/

2019-11-28 Thread Rasmus Villemoes
for an IRQCHIP_DECLARE, eliminating the need to manually look up the fsl,qe-ic node. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- arch/powerpc/platforms/83xx/km83xx.c | 1 - arch/powerpc/platforms/83xx/misc.c| 16 -- arch/powerpc/platforms/83xx/mpc832x_mds.c | 1

[PATCH v6 11/49] soc: fsl: qe: use qe_ic_cascade_{low, high}_mpic also on 83xx

2019-11-28 Thread Rasmus Villemoes
y done in mpc8xxx_gpio_irq_cascade(). This leaves the functions slightly misnamed, but that will be fixed in a subsequent patch. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- arch/powerpc/platforms/83xx/misc.c | 2 +- include/soc/fsl/qe/qe_ic.h | 24 2

[PATCH v6 10/49] soc: fsl: qe: remove pointless sysfs registration in qe_ic.c

2019-11-28 Thread Rasmus Villemoes
There's no point in registering with sysfs when that doesn't actually allow any interaction with the device or driver (no uevents, no sysfs files that provide information or allow configuration, no nothing). Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c

[PATCH v6 09/49] soc: fsl: qe: drop assign-only high_active in qe_ic_init

2019-11-28 Thread Rasmus Villemoes
high_active is only assigned to but never used. Remove it. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_ic.c b/drivers/soc/fsl/qe/qe_ic.c index 8c874372416b

[PATCH v6 08/49] soc: fsl: qe: drop unneeded #includes

2019-11-28 Thread Rasmus Villemoes
These includes are not actually needed, and asm/rheap.h and sysdev/fsl_soc.h are PPC-specific, hence prevent compiling QE for other architectures. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c| 5 - drivers/soc/fsl/qe/qe_io.c | 2 -- 2 files

[PATCH v6 07/49] soc: fsl: qe: qe.c: guard use of pvr_version_is() with CONFIG_PPC32

2019-11-28 Thread Rasmus Villemoes
from CONFIG_QUICC_ENGINE, so introduce qe_general4_errata() to keep the necessary #ifdeffery localized to a trivial helper. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH v6 06/49] soc: fsl: qe: replace spin_event_timeout by readx_poll_timeout_atomic

2019-11-28 Thread Rasmus Villemoes
In preparation for allowing QE to be built for architectures other than ppc, use the generic readx_poll_timeout_atomic() helper from iopoll.h rather than the ppc-only spin_event_timeout(). Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 13 +++-- 1

[PATCH v6 05/49] soc: fsl: qe: avoid ppc-specific io accessors

2019-11-28 Thread Rasmus Villemoes
) @@ expression addr, clr; @@ - clrbits32(addr, clr) + qe_clrbits_be32(addr, clr) @@ expression addr, clr; @@ - clrbits16(addr, clr) + qe_clrbits_be16(addr, clr) @@ expression addr, clr; @@ - clrbits8(addr, clr) + qe_clrbits_8(addr, clr) Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes

[PATCH v6 04/49] soc: fsl: qe: introduce qe_io{read,write}* wrappers

2019-11-28 Thread Rasmus Villemoes
a performance regression on powerpc when making the drivers work on other architectures, introduce qe_io* helpers. Also define the qe_{clr,set,clrset}bits* helpers in terms of these new macros. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- include/soc/fsl/qe/qe.h | 34

[PATCH v6 03/49] soc: fsl: qe: rename qe_(clr/set/clrset)bit* helpers

2019-11-28 Thread Rasmus Villemoes
Make it clear that these operate on big-endian registers (i.e. use the iowrite*be primitives) before we introduce more uses of them and allow the QE drivers to be built for platforms other than ppc32. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/net/wan/fsl_ucc_hdlc.c

[PATCH v6 02/49] soc: fsl: qe: drop volatile qualifier of struct qe_ic::regs

2019-11-28 Thread Rasmus Villemoes
-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_ic.c | 4 ++-- drivers/soc/fsl/qe/qe_ic.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_ic.c b/drivers/soc/fsl/qe/qe_ic.c index 9bac546998d3..791adcd121d1 100644 --- a/drivers/soc/fsl/qe/qe_ic.c +++ b

[PATCH v6 00/49] QUICC Engine support on ARM, ARM64, PPC64

2019-11-28 Thread Rasmus Villemoes
ur mpc8309 board. Qiang Zhao reports that the ucc_hdlc driver does indeed work on a ls1043ardb (arm64) board. Rasmus Villemoes (49): soc: fsl: qe: remove space-before-tab soc: fsl: qe: drop volatile qualifier of struct qe_ic::regs soc: fsl: qe: rename qe_(clr/set/clrset)bit* helpers so

[PATCH v6 01/49] soc: fsl: qe: remove space-before-tab

2019-11-28 Thread Rasmus Villemoes
Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c index 417df7e19281..2a0e6e642776 100644 --- a/drivers/soc/fsl/qe/qe.c +++ b/drivers/soc

  1   2   3   4   >