Re: [PATCH 1/2] string: Add stracpy and stracpy_pad mechanisms

2019-07-23 Thread Rasmus Villemoes
On 23/07/2019 02.38, Joe Perches wrote: > Several uses of strlcpy and strscpy have had defects because the > last argument of each function is misused or typoed. > > Add macro mechanisms to avoid this defect. > > stracpy (copy a string to a string array) must have a string > array as the first

[PATCH net-next] net: dsa: mv88e6xxx: avoid some redundant vtu load/purge operations

2019-07-22 Thread Rasmus Villemoes
ow whether mv88e6xxx_vtu_get() actually found an existing entry, or has just prepared a struct mv88e6xxx_vtu_entry for us to load. To that end, let vlan->valid be an output parameter. The other two callers of mv88e6xxx_vtu_get() are not affected by this patch since they pass new=false. Signed-off-by: Ras

Re: [PATCH v3 3/9] x86/mm/tlb: Open-code on_each_cpu_cond_mask() for tlb_is_not_lazy()

2019-07-22 Thread Rasmus Villemoes
On 19/07/2019 02.58, Nadav Amit wrote: > /* > @@ -865,7 +893,7 @@ void arch_tlbbatch_flush(struct arch_tlbflush_unmap_batch > *batch) > if (cpumask_test_cpu(cpu, >cpumask)) { > lockdep_assert_irqs_enabled(); > local_irq_disable(); > -

[PATCH v2] can: dev: call netif_carrier_off() in register_candev()

2019-07-22 Thread Rasmus Villemoes
always reflects the state of the CAN device. Signed-off-by: Rasmus Villemoes Acked-by: Willem de Bruijn --- v2: resending with proper subject (no net-next) and Willem's ack. drivers/net/can/dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c

Re: [PATCH v6 7/8] dynamic_debug: add asm-generic implementation for DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-06-26 Thread Rasmus Villemoes
On 27/06/2019 01.16, Nick Desaulniers wrote: > On Tue, Jun 25, 2019 at 3:18 PM Nick Desaulniers > wrote: > > The prints should show up in dmesg right, assuming you do something to > trigger them? Can you provide more details for a test case that's > easy to trip? What's an easy case to

Re: [PATCH net-next] can: dev: call netif_carrier_off() in register_candev()

2019-06-26 Thread Rasmus Villemoes
On 26/06/2019 16.17, Willem de Bruijn wrote: > On Wed, Jun 26, 2019 at 5:31 AM Rasmus Villemoes > wrote: >> >> On 24/06/2019 19.26, Willem de Bruijn wrote: >>> On Mon, Jun 24, 2019 at 4:34 AM Rasmus Villemoes >>> wrote: >>>> >>>> M

Re: [PATCH net-next] can: dev: call netif_carrier_off() in register_candev()

2019-06-26 Thread Rasmus Villemoes
On 24/06/2019 19.26, Willem de Bruijn wrote: > On Mon, Jun 24, 2019 at 4:34 AM Rasmus Villemoes > wrote: >> >> CONFIG_CAN_LEDS is deprecated. When trying to use the generic netdev >> trigger as suggested, there's a small inconsistency with the link >> property:

Re: [PATCH v6 7/8] dynamic_debug: add asm-generic implementation for DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-06-25 Thread Rasmus Villemoes
On 24/06/2019 23.53, Nick Desaulniers wrote: > On Thu, Jun 20, 2019 at 1:46 PM Rasmus Villemoes > wrote: >> >> I've pushed them to https://github.com/Villemoes/linux/tree/dyndebug_v6 >> . They rebase pretty cleanly to just about anything you might prefer >> tes

[PATCH net-next] can: dev: call netif_carrier_off() in register_candev()

2019-06-24 Thread Rasmus Villemoes
always reflects the state of the CAN device. Signed-off-by: Rasmus Villemoes --- drivers/net/can/dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index c05e4d50d43d..fad27ace6248 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c

Re: [PATCH 5/5] lib/list_sort: Optimize number of calls to comparison function

2019-06-21 Thread Rasmus Villemoes
On 14/03/2019 02.58, George Spelvin wrote: > On Thu, 14 Mar 2019 at 00:28:16 +0100, Rasmus Villemoes wrote: >> Similarly one could do a SORT_SIMPLE_CMP() for when sorting an array of >> structs according to a single numeric member. That sort is not stable, >> so the compa

Re: [PATCH v6 7/8] dynamic_debug: add asm-generic implementation for DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-06-20 Thread Rasmus Villemoes
On 18/06/2019 00.35, Nick Desaulniers wrote: > On Mon, Jun 17, 2019 at 3:20 PM Rasmus Villemoes > wrote: >> >> It relies on >> >> (1) standard assembly directives that should work on >> all architectures >> (2) the "i" constraint for an cons

[PATCH net-next] net: dsa: mv88e6xxx: introduce helpers for handling chip->reg_lock

2019-06-20 Thread Rasmus Villemoes
ome point, so this frees them from doing the 'sed -i' yoga, and have a much smaller 'git diff' while fiddling. Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/chip.c| 176 drivers/net/dsa/mv88e6xxx/chip.h| 10 ++ drivers/net/dsa/mv88e6

[PATCH net] net: dsa: mv88e6xxx: fix shift of FID bits in mv88e6185_g1_vtu_loadpurge()

2019-06-19 Thread Rasmus Villemoes
The comment is correct, but the code ends up moving the bits four places too far, into the VTUOp field. Fixes: 11ea809f1a74 (net: dsa: mv88e6xxx: support 256 databases) Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global1_vtu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH net-next] net: dsa: mv88e6xxx: fix shift of FID bits in mv88e6250_g1_vtu_loadpurge()

2019-06-19 Thread Rasmus Villemoes
The comment is correct, but the code ends up moving the bits four places too far, into the VTUOp field. Fixes: bec8e5725281 (net: dsa: mv88e6xxx: implement vtu_getnext and vtu_loadpurge for mv88e6250) Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global1_vtu.c | 2 +- 1 file

Re: [PATCH v3 1/3] lkdtm: Check for SMEP clearing protections

2019-06-18 Thread Rasmus Villemoes
On 18/06/2019 06.55, Kees Cook wrote: > +#else > + pr_err("FAIL: this test is x86_64-only\n"); > +#endif > +} Why expose it at all on all other architectures? If you wrap the CRASHTYPE() in an #ifdef, you can also guard the whole lkdtm_UNSET_SMEP definition (the declaration in lkdtm.h can

[PATCH v6 5/8] dynamic_debug: drop use of bitfields in struct _ddebug

2019-06-17 Thread Rasmus Villemoes
, there is a four byte hole after these fields, so we could just give flags and lineno each their own u32. But I don't think that's worth the ifdeffery. Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- include/linux/dynamic_debug.h | 12 -- lib/dynamic_debug.c | 44

[PATCH v6 3/8] linux/printk.h: use unique identifier for each struct _ddebug

2019-06-17 Thread Rasmus Villemoes
-by: Petr Mladek Acked-by: Jason Baron Cc: Steven Rostedt Signed-off-by: Rasmus Villemoes --- include/linux/printk.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/printk.h b/include/linux/printk.h index cefd374c47b1..54499c1a74fd 100644 --- a/include/linux

[PATCH v6 8/8] x86-64: select HAVE_DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-06-17 Thread Rasmus Villemoes
to add another #undef to vclock_gettime.c. Signed-off-by: Rasmus Villemoes --- arch/x86/Kconfig| 1 + arch/x86/entry/vdso/vdso32/vclock_gettime.c | 1 + arch/x86/include/asm/Kbuild | 1 + 3 files changed, 3 insertions(+) diff --git a/arch/x86/Kconfig b

[PATCH v6 4/8] dynamic_debug: introduce accessors for string members of struct _ddebug

2019-06-17 Thread Rasmus Villemoes
When we introduce compact versions of these pointers (a la CONFIG_GENERIC_BUG_RELATIVE_POINTERS), all access to these members must go via appropriate accessors. This just mass-converts dynamic_debug.c to use the new accessors. Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- lib

[PATCH v6 1/8] linux/device.h: use unique identifier for each struct _ddebug

2019-06-17 Thread Rasmus Villemoes
-by: Greg Kroah-Hartman Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- include/linux/device.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/device.h b/include/linux/device.h index 848fc71c6ba6..eaba6952c2b3 100644 --- a/include/linux/device.h +++ b

[PATCH v6 2/8] linux/net.h: use unique identifier for each struct _ddebug

2019-06-17 Thread Rasmus Villemoes
...@vger.kernel.org Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- include/linux/net.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/net.h b/include/linux/net.h index f7d672cf25b5..a080ede95b47 100644 --- a/include/linux/net.h +++ b/include/linux/net.h

[PATCH v6 6/8] dynamic_debug: introduce CONFIG_DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-06-17 Thread Rasmus Villemoes
toolchains, so the actual config option must be set by the user and not just selected by the various architectures. Still, the architecture must select HAVE_DYNAMIC_DEBUG_RELATIVE_POINTERS and is then responsible for providing a suitable DEFINE_DYNAMIC_DEBUG_METADATA macro in . Signed-off-by: Rasmus

[PATCH v6 7/8] dynamic_debug: add asm-generic implementation for DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-06-17 Thread Rasmus Villemoes
defconfig + CONFIG_DYNAMIC_DEBUG + patches to hook up this header, and boot-tested the x86-64 one. Signed-off-by: Rasmus Villemoes --- include/asm-generic/dynamic_debug.h | 116 include/linux/jump_label.h | 2 + lib/Kconfig.debug | 5 +- 3 files ch

[PATCH v6 0/8] implement DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-06-17 Thread Rasmus Villemoes
f the arch selecting it directly. Also, I've set a lower bound for the gcc and clang versions, so that hopefully nobody should be able to select the option and have the build break. Rasmus Villemoes (8): linux/device.h: use unique identifier for each struct _ddebug linux/net.h: use unique identifie

[PATCH] lib/sort.c: implement sort() variant taking context argument

2019-06-17 Thread Rasmus Villemoes
the indirect comparison calls in common cases. Requested-by: Boris Brezillon Signed-off-by: Rasmus Villemoes --- Hi Boris Sorry, completely dropped the ball on this one. Here's a formal patch with change log. I won't have time to do the other changes I mention this side of the merge window, so it's

Re: [RFC 1/6] rcu: Add support for consolidated-RCU reader checking

2019-06-04 Thread Rasmus Villemoes
On 02/06/2019 00.27, Joel Fernandes (Google) wrote: > This patch adds support for checking RCU reader sections in list > traversal macros. Optionally, if the list macro is called under SRCU or > other lock/mutex protection, then appropriate lockdep expressions can be > passed to make the checks

[PATCH net-next v4 03/10] net: dsa: mv88e6xxx: prepare mv88e6xxx_g1_atu_op() for the mv88e6250

2019-06-04 Thread Rasmus Villemoes
to prepare for supporting mv88e6250. Reviewed-by: Andrew Lunn Reviewed-by: Vivien Didelot Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global1_atu.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx/global1_atu.c b/drivers/net/dsa

[PATCH net-next v4 00/10] net: dsa: mv88e6xxx: support for mv88e6250

2019-06-04 Thread Rasmus Villemoes
patch adding the compatible string to the DT binding (9) - add small refactoring patch (10) v2: - rebase on top of net-next/master - add reviewed-by to two patches unchanged from v1 (2,3) - add separate watchdog_ops Rasmus Villemoes (10): net: dsa: mv88e6xxx: add mv88e6250_g1_ieee_pri_map net

[PATCH net-next v4 05/10] net: dsa: mv88e6xxx: implement watchdog_ops for mv88e6250

2019-06-04 Thread Rasmus Villemoes
The MV88E6352_G2_WDOG_CTL_* bits almost, but not quite, describe the watchdog control register on the mv88e6250. Among those actually referenced in the code, only QC_ENABLE differs (bit 6 rather than bit 5). Reviewed-by: Andrew Lunn Reviewed-by: Vivien Didelot Signed-off-by: Rasmus Villemoes

[PATCH net-next v4 08/10] net: dsa: mv88e6xxx: add support for mv88e6250

2019-06-04 Thread Rasmus Villemoes
2_{gpio,avb,ptp}_ops at first glance seem like they would work out-of-the-box, but for simplicity (and lack of testing) I'm eliding this. Reviewed-by: Andrew Lunn Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/chip.c| 81 + drivers/net/dsa/mv88

[PATCH net-next v4 02/10] net: dsa: mv88e6xxx: introduce support for two chips using direct smi addressing

2019-06-04 Thread Rasmus Villemoes
-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/chip.h | 6 ++ drivers/net/dsa/mv88e6xxx/smi.c | 25 - 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h index faa3fa889f19

[PATCH net-next v4 04/10] net: dsa: mv88e6xxx: implement vtu_getnext and vtu_loadpurge for mv88e6250

2019-06-04 Thread Rasmus Villemoes
adding a chip-specific vtu_op function, or adding chip-quirks to the existing one). Reviewed-by: Andrew Lunn Reviewed-by: Vivien Didelot Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global1.h | 4 ++ drivers/net/dsa/mv88e6xxx/global1_vtu.c | 58 + 2

[PATCH net-next v4 10/10] net: dsa: mv88e6xxx: refactor mv88e6352_g1_reset

2019-06-04 Thread Rasmus Villemoes
The new mv88e6250_g1_reset() is identical to mv88e6352_g1_reset() except for the call of mv88e6352_g1_wait_ppu_polling(), so refactor the 6352 version in term of the 6250 one. No functional change. Reviewed-by: Andrew Lunn Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global1.c

[PATCH net-next v4 06/10] net: dsa: mv88e6xxx: implement port_set_speed for mv88e6250

2019-06-04 Thread Rasmus Villemoes
that bits 13:8 are reserved... So without further information on what bit 8 means, let's stick to supporting just 10 and 100 Mbps on all ports. Reviewed-by: Andrew Lunn Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/port.c | 12 drivers/net/dsa/mv88e6xxx/port.h | 1

[PATCH net-next v4 07/10] net: dsa: mv88e6xxx: implement port_link_state for mv88e6250

2019-06-04 Thread Rasmus Villemoes
x3 and 0x5 are reserved), but I'm unable to make sense of them all. Since the bits simply reflect the Px_MODE[3:0] configuration pins, just support the subset that I'm certain about. Support for other setups can be added later. Reviewed-by: Andrew Lunn Signed-off-by: Rasmus Villemoes --- drive

[PATCH net-next v4 09/10] dt-bindings: net: dsa: marvell: add "marvell,mv88e6250" compatible string

2019-06-04 Thread Rasmus Villemoes
The mv88e6250 has port_base_addr 0x8 or 0x18 (depending on configuration pins), so it constitutes a new family and hence needs its own compatible string. Reviewed-by: Andrew Lunn Signed-off-by: Rasmus Villemoes --- Documentation/devicetree/bindings/net/dsa/marvell.txt | 7 +-- 1 file

[PATCH net-next v4 01/10] net: dsa: mv88e6xxx: add mv88e6250_g1_ieee_pri_map

2019-06-04 Thread Rasmus Villemoes
lly feels this is important enough to care. Reviewed-by: Andrew Lunn Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global1.c | 6 ++ drivers/net/dsa/mv88e6xxx/global1.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/global1.c b/drivers/net/

Re: arm64 patch

2019-06-03 Thread Rasmus Villemoes
On 22/05/2019 08.21, Rasmus Villemoes wrote: > On 22/05/2019 07.42, Andrew Morton wrote: > > Andrew, please drop the following five patches from your tree (sha1s as > per next-20190522): > > f418571688c5 powerpc: select DYNAMIC_DEBUG_RELATIVE_POINTERS for PPC64 > 0dd95

Re: [PATCH v3 0/6] soc/fsl/qe: cleanups and new DT binding

2019-06-03 Thread Rasmus Villemoes
On 13/05/2019 13.14, Rasmus Villemoes wrote: > This small series consists of some small cleanups and simplifications > of the QUICC engine driver, and introduces a new DT binding that makes > it much easier to support other variants of the QUICC engine IP block > that appears in the w

Re: [PATCH net-next v3 01/10] net: dsa: mv88e6xxx: add mv88e6250_g1_ieee_pri_map

2019-06-03 Thread Rasmus Villemoes
On 03/06/2019 17.37, Vivien Didelot wrote: > Hi Rasmus, > > On Mon, 3 Jun 2019 14:42:12 +0000, Rasmus Villemoes > wrote: >> Quite a few of the existing supported chips that use >> mv88e6085_g1_ieee_pri_map as ->ieee_pri_map (including, incidentally, >> mv88e6

[PATCH net-next v3 08/10] net: dsa: mv88e6xxx: add support for mv88e6250

2019-06-03 Thread Rasmus Villemoes
2_{gpio,avb,ptp}_ops at first glance seem like they would work out-of-the-box, but for simplicity (and lack of testing) I'm eliding this. Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/chip.c| 81 + drivers/net/dsa/mv88e6xxx/chip.h| 2 + drive

[PATCH net-next v3 06/10] net: dsa: mv88e6xxx: implement port_set_speed for mv88e6250

2019-06-03 Thread Rasmus Villemoes
that bits 13:8 are reserved... So without further information on what bit 8 means, let's stick to supporting just 10 and 100 Mbps on all ports. Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/port.c | 12 drivers/net/dsa/mv88e6xxx/port.h | 1 + 2 files changed, 13

[PATCH net-next v3 05/10] net: dsa: mv88e6xxx: implement watchdog_ops for mv88e6250

2019-06-03 Thread Rasmus Villemoes
The MV88E6352_G2_WDOG_CTL_* bits almost, but not quite, describe the watchdog control register on the mv88e6250. Among those actually referenced in the code, only QC_ENABLE differs (bit 6 rather than bit 5). Reviewed-by: Andrew Lunn Reviewed-by: Vivien Didelot Signed-off-by: Rasmus Villemoes

[PATCH net-next v3 07/10] net: dsa: mv88e6xxx: implement port_link_state for mv88e6250

2019-06-03 Thread Rasmus Villemoes
x3 and 0x5 are reserved), but I'm unable to make sense of them all. Since the bits simply reflect the Px_MODE[3:0] configuration pins, just support the subset that I'm certain about. Support for other setups can be added later. Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/p

[PATCH net-next v3 10/10] net: dsa: mv88e6xxx: refactor mv88e6352_g1_reset

2019-06-03 Thread Rasmus Villemoes
The new mv88e6250_g1_reset() is identical to mv88e6352_g1_reset() except for the call of mv88e6352_g1_wait_ppu_polling(), so refactor the 6352 version in term of the 6250 one. No functional change. Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global1.c | 14 +- 1

[PATCH net-next v3 09/10] dt-bindings: net: dsa: marvell: add "marvell,mv88e6250" compatible string

2019-06-03 Thread Rasmus Villemoes
The mv88e6250 has port_base_addr 0x8 or 0x18 (depending on configuration pins), so it constitutes a new family and hence needs its own compatible string. Signed-off-by: Rasmus Villemoes --- Documentation/devicetree/bindings/net/dsa/marvell.txt | 7 +-- 1 file changed, 5 insertions(+), 2

[PATCH net-next v3 02/10] net: dsa: mv88e6xxx: introduce support for two chips using direct smi addressing

2019-06-03 Thread Rasmus Villemoes
-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/chip.h | 6 ++ drivers/net/dsa/mv88e6xxx/smi.c | 25 - 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.h b/drivers/net/dsa/mv88e6xxx/chip.h index faa3fa889f19

[PATCH net-next v3 04/10] net: dsa: mv88e6xxx: implement vtu_getnext and vtu_loadpurge for mv88e6250

2019-06-03 Thread Rasmus Villemoes
adding a chip-specific vtu_op function, or adding chip-quirks to the existing one). Reviewed-by: Andrew Lunn Reviewed-by: Vivien Didelot Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global1.h | 4 ++ drivers/net/dsa/mv88e6xxx/global1_vtu.c | 58 + 2

[PATCH net-next v3 03/10] net: dsa: mv88e6xxx: prepare mv88e6xxx_g1_atu_op() for the mv88e6250

2019-06-03 Thread Rasmus Villemoes
to prepare for supporting mv88e6250. Reviewed-by: Andrew Lunn Reviewed-by: Vivien Didelot Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global1_atu.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx/global1_atu.c b/drivers/net/dsa

[PATCH net-next v3 00/10] net: dsa: mv88e6xxx: support for mv88e6250

2019-06-03 Thread Rasmus Villemoes
ng patch (10) v2: - rebase on top of net-next/master - add reviewed-by to two patches unchanged from v1 (2,3) - add separate watchdog_ops Rasmus Villemoes (10): net: dsa: mv88e6xxx: add mv88e6250_g1_ieee_pri_map net: dsa: mv88e6xxx: introduce support for two chips using direct smi addre

[PATCH net-next v3 01/10] net: dsa: mv88e6xxx: add mv88e6250_g1_ieee_pri_map

2019-06-03 Thread Rasmus Villemoes
lly feels this is important enough to care. Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global1.c | 6 ++ drivers/net/dsa/mv88e6xxx/global1.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/dsa/mv88e6xxx/global1.c b/drivers/net/dsa/mv88e6xxx/global1.c in

Re: [PATCH v2 5/5] net: dsa: add support for mv88e6250

2019-06-03 Thread Rasmus Villemoes
On 24/05/2019 16.27, Andrew Lunn wrote: >> @@ -4841,6 +4910,10 @@ static const struct of_device_id mv88e6xxx_of_match[] >> = { >> .compatible = "marvell,mv88e6190", >> .data = _table[MV88E6190], >> }, >> +{ >> +.compatible = "marvell,mv88e6250", >> +

[PATCH] net: dsa: mv88e6xxx: make mv88e6xxx_g1_stats_wait static

2019-06-03 Thread Rasmus Villemoes
mv88e6xxx_g1_stats_wait has no users outside global1.c, so make it static. Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global1.c | 2 +- drivers/net/dsa/mv88e6xxx/global1.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/global1.c

[PATCH net-next] net: dsa: mv88e6xxx: fix comments and macro names in mv88e6390_g1_mgmt_rsvd2cpu

2019-06-03 Thread Rasmus Villemoes
The macros have an extraneous '800' (after 0180C2 there should be just six nibbles, with X representing one), while the comments have interchanged c2 and 80 and an extra :00. Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global1.c | 16 drivers/net/dsa/mv88e6xxx

[PATCH net v2] net: dsa: mv88e6xxx: fix handling of upper half of STATS_TYPE_PORT

2019-05-29 Thread Rasmus Villemoes
Currently, the upper half of a 4-byte STATS_TYPE_PORT statistic ends up in bits 47:32 of the return value, instead of bits 31:16 as they should. Fixes: 6e46e2d821bb ("net: dsa: mv88e6xxx: Fix u64 statistics") Signed-off-by: Rasmus Villemoes --- v2: include Fixes tag, use proper subj

Re: [PATCH] net: dsa: mv88e6xxx: fix handling of upper half of STATS_TYPE_PORT

2019-05-29 Thread Rasmus Villemoes
On 28/05/2019 15.44, Andrew Lunn wrote: > On Tue, May 28, 2019 at 01:17:10PM +0000, Rasmus Villemoes wrote: >> Currently, the upper half of a 4-byte STATS_TYPE_PORT statistic ends >> up in bits 47:32 of the return value, instead of bits 31:16 as they >> should. >&g

[PATCH] net: dsa: mv88e6xxx: fix handling of upper half of STATS_TYPE_PORT

2019-05-28 Thread Rasmus Villemoes
Currently, the upper half of a 4-byte STATS_TYPE_PORT statistic ends up in bits 47:32 of the return value, instead of bits 31:16 as they should. Signed-off-by: Rasmus Villemoes --- I also noticed that it's a bit inconsistent that we return U64_MAX if there's a read error in STATS_TYPE_PORT

Re: LZ4 decompressor broken on ARM due to missing strchrnul() string traverse in cpumask_parse"

2019-05-28 Thread Rasmus Villemoes
ingle call of strchrnul(). > > [a...@linux-foundation.org: remove unneeded cast] > Link: http://lkml.kernel.org/r/20190409204208.12190-1-yno...@marvell.com > Signed-off-by: Yury Norov > Acked-by: Rasmus Villemoes > Signed-off-by: Andrew Morton > Signed-off-by:

Re: lib/test_overflow.c causes WARNING and tainted kernel

2019-05-27 Thread Rasmus Villemoes
On 25/05/2019 17.33, Randy Dunlap wrote: > On 3/13/19 7:53 PM, Kees Cook wrote: >> Hi! >> >> On Wed, Mar 13, 2019 at 2:29 PM Randy Dunlap wrote: >>> >>> This is v5.0-11053-gebc551f2b8f9, MAR-12 around 4:00pm PT. >>> >>> In the first test_kmalloc() in test_overflow_allocation(): >>> >>>

[PATCH v2 5/5] net: dsa: add support for mv88e6250

2019-05-24 Thread Rasmus Villemoes
to still be wrong. The chip uses the new dual_chip option, and since its port registers start at SMI address 0x08 or 0x18 (i.e., always 0x08 + sw_addr), we need to introduce it as a new family in order for the auto-identification in mv88e6xxx_detect() to work. Signed-off-by: Rasmus Villemoes

[PATCH v2 1/5] net: dsa: mv88e6xxx: introduce support for two chips using direct smi addressing

2019-05-24 Thread Rasmus Villemoes
[since ADDR4 is internally pulled high, the latter is the default]. In order to prepare for supporting the 88e6250 and friends, introduce mv88e6xxx_info::dual_chip to allow having a non-zero sw_addr while still using direct addressing. Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx

[PATCH v2 3/5] net: dsa: implement vtu_getnext and vtu_loadpurge for mv88e6250

2019-05-24 Thread Rasmus Villemoes
adding a chip-specific vtu_op function, or adding chip-quirks to the existing one). Reviewed-by: Andrew Lunn Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global1.h | 4 ++ drivers/net/dsa/mv88e6xxx/global1_vtu.c | 58 + 2 files changed, 62 insertions

[PATCH v2 2/5] net: dsa: prepare mv88e6xxx_g1_atu_op() for the mv88e6250

2019-05-24 Thread Rasmus Villemoes
to prepare for supporting mv88e6250. Reviewed-by: Andrew Lunn Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global1_atu.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx/global1_atu.c b/drivers/net/dsa/mv88e6xxx/global1_atu.c index

[PATCH v2 4/5] net: dsa: mv88e6xxx: implement watchdog_ops for mv88e6250

2019-05-24 Thread Rasmus Villemoes
The MV88E6352_G2_WDOG_CTL_* bits almost, but not quite, describe the watchdog control register on the mv88e6250. Among those actually referenced in the code, only QC_ENABLE differs (bit 6 rather than bit 5). Signed-off-by: Rasmus Villemoes --- drivers/net/dsa/mv88e6xxx/global2.c | 26

[PATCH v2 0/5] net: dsa: support for mv88e6250

2019-05-24 Thread Rasmus Villemoes
from v1 (2,3) - add separate watchdog_ops Rasmus Villemoes (5): net: dsa: mv88e6xxx: introduce support for two chips using direct smi addressing net: dsa: prepare mv88e6xxx_g1_atu_op() for the mv88e6250 net: dsa: implement vtu_getnext and vtu_loadpurge for mv88e6250 net: dsa: mv88e6xxx

Re: [PATCH] lib/sort: Add the sort_r() variant

2019-05-23 Thread Rasmus Villemoes
On 22/05/2019 13.25, Boris Brezillon wrote: > Some users might need extra context to compare 2 elements. This patch > adds the sort_r() which is similar to the qsort_r() variant of qsort(). > > Signed-off-by: Boris Brezillon > --- > Hello, > > A few more details about this patch. > > Even

Re: arm64 patch

2019-05-22 Thread Rasmus Villemoes
On 22/05/2019 07.42, Andrew Morton wrote: > On Tue, 14 May 2019 20:31:58 -0700 Nathan Chancellor > wrote: > >> On Tue, May 14, 2019 at 04:16:19PM -0700, 'Nick Desaulniers' via Clang Built >> Linux wrote: >>> do we know if >>> https://lkml.org/lkml/2019/4/29/743 >>>

Re: [PATCH 1/2] open: add close_range()

2019-05-21 Thread Rasmus Villemoes
On 21/05/2019 13.34, Christian Brauner wrote: > The performance is striking. For good measure, comparing the following > simple close_all_fds() userspace implementation that is essentially just > glibc's version in [6]: > > static int close_all_fds(void) > { > DIR *dir; > struct

[PATCH] RFC: genirq: allow userspace to set default priority of irq threads

2019-05-16 Thread Rasmus Villemoes
the affinity settings, but the problem with that is that the /proc entries don't exist until __setup_irq() is called the first time. [Btw, why are the sysfs files dependent on CONFIG_SPARSE_IRQ?] Signed-off-by: Rasmus Villemoes --- include/linux/irqdesc.h | 2 ++ kernel/irq/irqdesc.c| 57

[PATCH v3 3/6] soc/fsl/qe: qe.c: introduce qe_get_device_node helper

2019-05-13 Thread Rasmus Villemoes
The 'try of_find_compatible_node(NULL, NULL, "fsl,qe"), fall back to of_find_node_by_type(NULL, "qe")' pattern is repeated five times. Factor it into a common helper. Reviewed-by: Christophe Leroy Reviewed-by: Qiang Zhao Signed-off-by: Rasmus Villemoes --- drivers/

[PATCH v3 4/6] dt-bindings: soc/fsl: qe: document new fsl,qe-snums binding

2019-05-13 Thread Rasmus Villemoes
of the QUICC engine IP, this introduces a new binding fsl,qe-snums, which automatically encodes both the number of snums and the actual values to use. Signed-off-by: Rasmus Villemoes --- Rob, thanks for the review of v2. However, since I moved the example from the commit log to the binding (per

[PATCH v3 2/6] soc/fsl/qe: qe.c: reduce static memory footprint by 1.7K

2019-05-13 Thread Rasmus Villemoes
in a 32 byte bitmap. So this reduces the .data footprint by 1760 bytes. It also serves as preparation for introducing another DT binding for specifying the snum values. Reviewed-by: Christophe Leroy Reviewed-by: Qiang Zhao Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 42

[PATCH v3 1/6] soc/fsl/qe: qe.c: drop useless static qualifier

2019-05-13 Thread Rasmus Villemoes
The local variable snum_init has no reason to have static storage duration. Reviewed-by: Christophe Leroy Reviewed-by: Qiang Zhao Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qe/qe.c b/drivers

[PATCH v3 5/6] soc/fsl/qe: qe.c: support fsl,qe-snums property

2019-05-13 Thread Rasmus Villemoes
cannot assign directly to num_of_snums, since we need to check whether the return value is negative. Reviewed-by: Christophe Leroy Reviewed-by: Qiang Zhao Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff

[PATCH v3 6/6] soc/fsl/qe: qe.c: fold qe_get_num_of_snums into qe_snums_init

2019-05-13 Thread Rasmus Villemoes
Qiang Zhao Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 46 ++--- 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c index 1d27187b251c..852060caff24 100644 --- a/drivers/soc/fsl/qe/

[PATCH v3 0/6] soc/fsl/qe: cleanups and new DT binding

2019-05-13 Thread Rasmus Villemoes
the existing example pertains to). - Add more review tags. - Fix minor style issue. v2: - Address comments from Christophe Leroy - Add his Reviewed-by to 1/6 and 3/6 - Split DT binding update to separate patch as per Documentation/devicetree/bindings/submitting-patches.txt Rasmus Villemoes (6): soc/fsl

Re: [PATCH] arm64: add support for rng-seed

2019-05-10 Thread Rasmus Villemoes
On 09/05/2019 10.00, Hsin-Yi Wang wrote: Why do you need to clear it? That wasn't necessary for kaslr-seed. >>> I think it's for security purpose. If we know the random seed, it's >>> more likely we can predict randomness. >>> Currently on arm64, kaslr-seed will be wiped out (in >>>

Re: [PATCH AUTOSEL 4.14 79/95] x86/asm: Remove dead __GNUC__ conditionals

2019-05-06 Thread Rasmus Villemoes
On 07/05/2019 07.38, Sasha Levin wrote: > From: Rasmus Villemoes > > [ Upstream commit 88ca66d8540ca26119b1428cddb96b37925bdf01 ] > > The minimum supported gcc version is >= 4.6, so these can be removed. Eh, that bump happened for the 4.19 kernel, so this is not true for th

Re: [PATCH] mod_devicetable.h: reduce sizeof(struct of_device_id) by 80 bytes

2019-05-02 Thread Rasmus Villemoes
On 02/05/2019 14.29, Jeff Mahoney wrote: > On 5/2/19 5:41 AM, Rasmus Villemoes wrote: >> But we cannot really know whether there is some userspace tool that >> parses the .ko ELF objects the same way that file2alias does, doing >> pattern matching on the symbol names etc. I c

Re: [PATCH] mod_devicetable.h: reduce sizeof(struct of_device_id) by 80 bytes

2019-05-02 Thread Rasmus Villemoes
On 26/04/2019 11.27, Arnd Bergmann wrote: > On Thu, Apr 25, 2019 at 10:31 PM Rasmus Villemoes > wrote: >> >> For an arm imx_v6_v7_defconfig kernel, .rodata becomes 70K smaller; >> .init.data shrinks by another ~13K, making the whole kernel image >> about 83K, or 0

Re: [PATCH 11/10] arm64: unbreak DYNAMIC_DEBUG=y build with clang

2019-05-02 Thread Rasmus Villemoes
On 30/04/2019 20.22, Nick Desaulniers wrote: > On Mon, Apr 29, 2019 at 10:32 AM Nick Desaulniers > wrote: >> >> On Fri, Apr 26, 2019 at 12:06 PM Rasmus Villemoes >> wrote: >>> >>> Current versions of clang does not like the %c modifier in inline >&

Re: [PATCH 1/6] lib/string: add strnchrnul()

2019-04-28 Thread Rasmus Villemoes
On 28/04/2019 05.29, Yury Norov wrote: > New function works like strchrnul() with a length limited strings. > > Signed-off-by: Yury Norov > --- > include/linux/string.h | 3 +++ > lib/string.c | 20 > 2 files changed, 23 insertions(+) > > diff --git

Re: [PATCH 11/10] arm64: unbreak DYNAMIC_DEBUG=y build with clang

2019-04-26 Thread Rasmus Villemoes
On 26/04/2019 21.06, Rasmus Villemoes wrote: > Andrew, please apply and/or fold into 9/10. Hm, I'm getting bounces for Andrew's email address: The mail system : host 172.17.192.39[172.17.192.39] said: 550 5.1.1 : Recipient address rejected: User unknown in lo

[PATCH 11/10] arm64: unbreak DYNAMIC_DEBUG=y build with clang

2019-04-26 Thread Rasmus Villemoes
: select DYNAMIC_DEBUG_RELATIVE_POINTERS Reported-by: Nathan Chancellor Reported-by: Arnd Bergmann Signed-off-by: Rasmus Villemoes --- Andrew, please apply and/or fold into 9/10. arch/arm64/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/Kconfig b/arch/arm64

[PATCH 12/10] powerpc: unbreak DYNAMIC_DEBUG=y build with clang

2019-04-26 Thread Rasmus Villemoes
: select DYNAMIC_DEBUG_RELATIVE_POINTERS for PPC64 Reported-by: Nathan Chancellor Reported-by: Arnd Bergmann Signed-off-by: Rasmus Villemoes --- Andrew, please apply and/or fold into 10/10. arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc

Re: [PATCH] mod_devicetable.h: reduce sizeof(struct of_device_id) by 80 bytes

2019-04-26 Thread Rasmus Villemoes
On 26/04/2019 13.05, Enrico Weigelt, metux IT consult wrote: > On 25.04.19 22:31, Rasmus Villemoes wrote: > > Hi, > >> A typical kernel image has hundreds of static struct of_device_id >> instances (a lot of which are sentinel all-zeroes), each occupying >>

Re: [PATCH 09/10] arm64: select DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-04-26 Thread Rasmus Villemoes
On 26/04/2019 11.39, Arnd Bergmann wrote: > On Tue, Apr 9, 2019 at 11:26 PM Rasmus Villemoes > wrote: >> >> Similar to GENERIC_BUG_RELATIVE_POINTERS, one can now relativize the >> four const char* members of struct _ddebug, thus saving 16 bytes per >> instance (one

[PATCH] mod_devicetable.h: reduce sizeof(struct of_device_id) by 80 bytes

2019-04-25 Thread Rasmus Villemoes
r. Signed-off-by: Rasmus Villemoes --- include/linux/mod_devicetable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 448621c32e4d..502629bdac2e 100644 --- a/include/linux/mod_devicetable.h +++ b/inc

[PATCH] kernel/user.c: clean up some leftover code

2019-04-24 Thread Rasmus Villemoes
The out_unlock label is misleading; no unlocking happens after it, so just return NULL directly. Also, nothing between the kmem_cache_zalloc() that creates new and the two key_put() can initialize new->uid_keyring or new->session_keyring, so those calls are no-ops. Signed-off-by: Rasmus Vil

[tip:core/core] overflow.h: Add comment documenting __ab_c_size()

2019-04-12 Thread tip-bot for Rasmus Villemoes
Commit-ID: e0478542cfd4d993e38d5f92a3f3ecd238805e96 Gitweb: https://git.kernel.org/tip/e0478542cfd4d993e38d5f92a3f3ecd238805e96 Author: Rasmus Villemoes AuthorDate: Wed, 10 Apr 2019 22:27:25 +0200 Committer: Borislav Petkov CommitDate: Fri, 12 Apr 2019 13:44:24 +0200 overflow.h: Add

[PATCH] bitops.h: sanitize rotate primitives

2019-04-10 Thread Rasmus Villemoes
ts in [0, 16] (only mostly - u16 gets promoted to _signed_ int, so if bit 15 is set, word << 16 is undefined). For consistency, update those as well. Reported-by: Ido Schimmel Cc: Vadim Pasternak Signed-off-by: Rasmus Villemoes --- include/linux/bitops.h | 16 1 file

[tip:core/core] overflow.h: Add comment documenting __ab_c_size()

2019-04-10 Thread tip-bot for Rasmus Villemoes
Commit-ID: 899cbdfa8d147c873fe4e66c38d2cca3c1ac6286 Gitweb: https://git.kernel.org/tip/899cbdfa8d147c873fe4e66c38d2cca3c1ac6286 Author: Rasmus Villemoes AuthorDate: Wed, 10 Apr 2019 22:27:25 +0200 Committer: Borislav Petkov CommitDate: Wed, 10 Apr 2019 22:35:47 +0200 overflow.h: Add

Re: [PATCH] cpumask: fix double string traverse in cpumask_parse

2019-04-09 Thread Rasmus Villemoes
On 09/04/2019 22.42, Yury Norov wrote: > From: Yury Norov > > cpumask_parse() finds first occurrence of either \n or \0 by calling > strchr() and strlen(). We can do it better with a single call of > strchrnul(). > > Signed-off-by: Yury Norov > --- > include/linux/cpumask.h | 3 +-- > 1 file

[PATCH 08/10] x86-64: select DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-04-09 Thread Rasmus Villemoes
another #undef to vclock_gettime.c. Signed-off-by: Rasmus Villemoes --- arch/x86/Kconfig| 1 + arch/x86/entry/vdso/vdso32/vclock_gettime.c | 1 + arch/x86/include/asm/Kbuild | 1 + 3 files changed, 3 insertions(+) diff --git a/arch/x86/Kconfig b/arch

[PATCH 06/10] dynamic_debug: introduce CONFIG_DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-04-09 Thread Rasmus Villemoes
a suitable DEFINE_DYNAMIC_DEBUG_METADATA macro in . Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- include/linux/dynamic_debug.h | 14 ++ lib/Kconfig.debug | 3 +++ lib/dynamic_debug.c | 20 3 files changed, 37 insertions(+) diff

[PATCH 05/10] dynamic_debug: drop use of bitfields in struct _ddebug

2019-04-09 Thread Rasmus Villemoes
, there is a four byte hole after these fields, so we could just give flags and lineno each their own u32. But I don't think that's worth the ifdeffery. Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- include/linux/dynamic_debug.h | 12 -- lib/dynamic_debug.c | 44

[PATCH 07/10] dynamic_debug: add asm-generic implementation for DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-04-09 Thread Rasmus Villemoes
ne expects. I've succesfully built x86-64, arm64 and ppc64 defconfig + CONFIG_DYNAMIC_DEBUG + patches to hook up this header, and boot-tested the x86-64 one. Signed-off-by: Rasmus Villemoes --- include/asm-generic/dynamic_debug.h | 116 include/linux/jump_label.h

[PATCH 00/10] implement DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-04-09 Thread Rasmus Villemoes
stuff is in patch 7, and the remaining three patches are just the minimal boilerplate to hook up the config option and asm-generic header on the three architectures. Rasmus Villemoes (10): linux/device.h: use unique identifier for each struct _ddebug linux/net.h: use unique identifier for each

[PATCH 09/10] arm64: select DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-04-09 Thread Rasmus Villemoes
this is only compile-tested. Signed-off-by: Rasmus Villemoes --- arch/arm64/Kconfig| 1 + arch/arm64/include/asm/Kbuild | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 7e34b9eba5de..d0871d523d5d 100644 --- a/arch/arm64/Kconfig +++ b/arch

[PATCH 01/10] linux/device.h: use unique identifier for each struct _ddebug

2019-04-09 Thread Rasmus Villemoes
-by: Greg Kroah-Hartman Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- include/linux/device.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/device.h b/include/linux/device.h index 4e6987e11f68..64b95a913fef 100644 --- a/include/linux/device.h +++ b

<    1   2   3   4   5   6   7   8   9   10   >