[PATCH 2/4] leds: netdev trigger: factor out middle part of device_name_store

2019-03-13 Thread Rasmus Villemoes
. Signed-off-by: Rasmus Villemoes --- drivers/leds/trigger/ledtrig-netdev.c | 30 --- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index ddc2b90ad7ec..55153a7e8433 100644

[PATCH 0/4] leds: netdev trigger: allow setting initial values in device tree

2019-03-13 Thread Rasmus Villemoes
n away from the deprecated CONFIG_CAN_LEDS. Rasmus Villemoes (4): leds: netdev trigger: use memcpy in device_name_store leds: netdev trigger: factor out middle part of device_name_store leds: netdev trigger: add documentation to leds/common.txt leds: netdev trigger: allow setting initial v

[PATCH 1/4] leds: netdev trigger: use memcpy in device_name_store

2019-03-13 Thread Rasmus Villemoes
of course, we also still have to strip a trailing newline. This is also preparation for future patches. Signed-off-by: Rasmus Villemoes --- drivers/leds/trigger/ledtrig-netdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/driv

Re: [PATCH 1/5] lib/sort: Make swap functions more generic

2019-03-13 Thread Rasmus Villemoes
On 21/02/2019 07.30, George Spelvin wrote: > Rather than u32_swap and u64_swap working on 4- and 8-byte objects > directly, let them handle any multiple of 4 or 8 bytes. This speeds > up most users of sort() by avoiding fallback to the byte copy loop. > > Despite what commit ca96ab859ab4 ("lib/so

Re: [PATCH 2/5] lib/sort: Use more efficient bottom-up heapsort variant

2019-03-13 Thread Rasmus Villemoes
On 21/02/2019 09.21, George Spelvin wrote: > > +/** > + * parent - given the offset of the child, find the offset of the parent. > + * @i: the offset of the heap element whose parent is sought. Non-zero. > + * @lsbit: a precomputed 1-bit mask, equal to "size & -size" > + * @size: size of each el

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

2019-03-13 Thread Rasmus Villemoes
On 05/03/2019 06.58, George Spelvin wrote: > CONFIG_RETPOLINE has severely degraded indirect function call > performance, so it's worth putting some effort into reducing > the number of times cmp() is called. > > This patch avoids badly unbalanced merges on unlucky input sizes. > It slightly incre

Re: [PATCH 2/5] lib/sort: Use more efficient bottom-up heapsort variant

2019-03-13 Thread Rasmus Villemoes
On 14/03/2019 01.03, George Spelvin wrote: > On Wed, 13 Mar 2019 at 23:29:40 +0100, Rasmus Villemoes wrote: > >> Nice! > > Thank you. May I translate that into Acked-by? > Sort-of. I prefer first seeing the full rerolled series for context etc., even if (the important

Re: [PATCH 1/4] leds: netdev trigger: use memcpy in device_name_store

2019-03-14 Thread Rasmus Villemoes
On 14/03/2019 10.29, Uwe Kleine-König wrote: > Hello, > > On Wed, Mar 13, 2019 at 09:26:12PM +0100, Rasmus Villemoes wrote: >> --- a/drivers/leds/trigger/ledtrig-netdev.c >> +++ b/drivers/leds/trigger/ledtrig-netdev.c >> @@ -122,7 +122,8 @@ static ssize_t device_na

Re: [PATCH 2/4] leds: netdev trigger: factor out middle part of device_name_store

2019-03-14 Thread Rasmus Villemoes
On 14/03/2019 10.31, Uwe Kleine-König wrote: > Hello, > > On Wed, Mar 13, 2019 at 09:26:13PM +0100, Rasmus Villemoes wrote: >> +static void set_device(struct led_netdev_data *trigger_data, >> + const char *buf, size_t size) > > "set_device&

Re: [PATCH 1/4] leds: netdev trigger: use memcpy in device_name_store

2019-03-14 Thread Rasmus Villemoes
On 14/03/2019 11.14, Pavel Machek wrote: > Hi! > >> If userspace doesn't end the input with a newline (which can easily >> happen if the write happens from a C program that does write(fd, >> iface, strlen(iface))), we may end up including garbage from a >> previous, longer value in the device_name

Re: [PATCH v4] lib/string.c: implement a basic bcmp

2019-03-14 Thread Rasmus Villemoes
On 14/03/2019 10.57, David Laight wrote: > From: Nick Desaulniers >> Sent: 13 March 2019 21:14 > ... >> diff --git a/include/linux/string.h b/include/linux/string.h >> index 7927b875f80c..6ab0a6fa512e 100644 >> --- a/include/linux/string.h >> +++ b/include/linux/string.h >> @@ -150,6 +150,9 @@ exte

[PATCH v2 0/6] leds: netdev trigger: allow setting initial values in device tree

2019-03-14 Thread Rasmus Villemoes
] * add a patch allowing echoing 15-character names to device_name * ensure the length checking is done in one place [Uwe] * drop hunk from CAN Kconfig file for now [Uwe] * don't mention CONFIG_CAN_LEDS in device tree binding [Uwe] * guard netdev_trig_of_init by LED_INIT_DEFAULT_TRIGGER

[PATCH v2 5/6] leds: netdev trigger: add documentation to leds/common.txt

2019-03-14 Thread Rasmus Villemoes
The various sysfs files used to configure a netdev-triggered LED are already documented, but let's also add "netdev" to the list of things one can reasonably set linux,default-trigger to. Signed-off-by: Rasmus Villemoes --- Documentation/devicetree/bindings/leds/common.txt

[PATCH v2 2/6] leds: netdev trigger: factor out middle part of device_name_store

2019-03-14 Thread Rasmus Villemoes
. Signed-off-by: Rasmus Villemoes --- drivers/leds/trigger/ledtrig-netdev.c | 30 --- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index 8d476b92f58c..21605033e322 100644

[PATCH v2 4/6] leds: netdev trigger: move name length checking to netdev_trig_set_device

2019-03-14 Thread Rasmus Villemoes
up by the set_baseline_state() call. Signed-off-by: Rasmus Villemoes --- drivers/leds/trigger/ledtrig-netdev.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index c35439291424..e4a76ce4e4c7 10

[PATCH v2 6/6] leds: netdev trigger: allow setting initial values in device tree

2019-03-14 Thread Rasmus Villemoes
CONFIG_CAN_LEDS. The example added to common.txt corresponds to switching linux,default-trigger = "can0-rxtx" to "netdev" and adding the indicated netdev subnode. Signed-off-by: Rasmus Villemoes --- .../devicetree/bindings/leds/common.txt | 11 +++ drivers/leds/trig

[PATCH v2 1/6] leds: netdev trigger: use memcpy in device_name_store

2019-03-14 Thread Rasmus Villemoes
of course, we also still have to strip a trailing newline. This is also preparation for future patches. Signed-off-by: Rasmus Villemoes --- drivers/leds/trigger/ledtrig-netdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/driv

[PATCH v2 3/6] leds: netdev trigger: move newline handling back to device_name_store

2019-03-14 Thread Rasmus Villemoes
es it gave us, so we have to stash the original value of size. Signed-off-by: Rasmus Villemoes --- drivers/leds/trigger/ledtrig-netdev.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.

Re: [PATCH v2 6/6] leds: netdev trigger: allow setting initial values in device tree

2019-03-14 Thread Rasmus Villemoes
On 14/03/2019 15.24, Jacek Anaszewski wrote: > Rasmus, > > Thank you for the update. > Still, there is one thing to improve. > >>   static int netdev_trig_activate(struct led_classdev *led_cdev) >>   { >>   struct led_netdev_data *trigger_data; >> @@ -423,6 +451,8 @@ static int netdev_trig_a

[PATCH] xfs: allow disabling xfs tracepoints via Kconfig

2019-02-04 Thread Rasmus Villemoes
632 676487 a5287 /tmp/xfs/a/xfs.ko 893192 166737 632 1060561 102ed1 /tmp/xfs/b/xfs.ko Signed-off-by: Rasmus Villemoes --- fs/xfs/Kconfig | 9 + fs/xfs/xfs_trace.h | 4 2 files changed, 13 insertions(+) diff --git a/fs/xfs/Kconfig b/fs/xfs/Kconfig index 457ac9f97377

Re: [PATCH] xfs: allow disabling xfs tracepoints via Kconfig

2019-02-04 Thread Rasmus Villemoes
On 04/02/2019 22.53, Dave Chinner wrote: > On Mon, Feb 04, 2019 at 10:20:35PM +0100, Rasmus Villemoes wrote: >> linux/tracepoints.h allows individual subsystems to disable their >> tracepoints. Add such a knob for xfs. Disabling XFS_TRACEPOINTS >> reduces the resident size

Re: [PATCH] build_bug.h: add wrapper for _Static_assert

2019-02-05 Thread Rasmus Villemoes
On 05/02/2019 09.05, Masahiro Yamada wrote: > On Mon, Feb 4, 2019 at 4:24 AM Rasmus Villemoes > wrote: >> >> BUILD_BUG_ON() is a little annoying, since it cannot be used outside >> function scope. So one cannot put assertions about the sizeof() a >> struct next to

Re: [PATCH] build_bug.h: add wrapper for _Static_assert

2019-02-05 Thread Rasmus Villemoes
On 05/02/2019 00.12, Andrew Morton wrote: >> >> It would be (very) nice to actually use this macro in a few places so >> it gets its build testing while in -next. > > ie, just about every BUILD_BUG_ON in mm/ could use this. Let's switch > a few? > Perhaps, but some make sense where they are, e.

Re: [PATCH] xfs: allow disabling xfs tracepoints via Kconfig

2019-02-05 Thread Rasmus Villemoes
On 05/02/2019 00.13, Dave Chinner wrote: > On Mon, Feb 04, 2019 at 11:12:57PM +0100, Rasmus Villemoes wrote: >> On 04/02/2019 22.53, Dave Chinner wrote: >>> On Mon, Feb 04, 2019 at 10:20:35PM +0100, Rasmus Villemoes wrote: >>>> linux/tracepoints.h allows individu

Re: [PATCH 16/32] x86/vdso: Generate vdso{,32}-timens.lds

2019-02-07 Thread Rasmus Villemoes
On 06/02/2019 01.10, Dmitry Safonov wrote: > As it has been discussed on timens RFC, adding a new conditional branch > `if (inside_time_ns)` on VDSO for all processes is undesirable. > It will add a penalty for everybody as branch predictor may mispredict > the jump. Also there are instruction cach

Re: [PATCH] Change in comment for the list_empty() routine.

2019-03-26 Thread Rasmus Villemoes
On 26/03/2019 07.21, Nitin U. Yewale wrote: > Hello, > > In one of the observations it was noticed that list_empty() routine > returns true when the list is empty (head->next == head) OR False > otherwise. Hence the proposed patch. Hm, does anything use that file? It's almost impossible to have a

Re: [PATCH 14/17] crypto: Don't mark AES tables const and cacheline_aligned

2019-03-26 Thread Rasmus Villemoes
On 21/03/2019 23.00, Andi Kleen wrote: > From: Andi Kleen > > cacheline_aligned is a special section. It cannot be const at the same > time because it's not read-only. It doesn't give any MMU protection. Urgh. Perhaps this instead just wanted to use the quadruple underscore version, cachelin

Re: [PATCH v2 6/6] lib/vsprintf: Add %pfw conversion specifier for printing fwnode names

2019-03-26 Thread Rasmus Villemoes
On 26/03/2019 13.41, Sakari Ailus wrote: > Add support for %pfw conversion specifier (with "f" and "P" modifiers) to > support printing full path of the node, including its name ("f") and only > the node's name ("P") in the printk family of functions. The two flags > have equivalent functionality t

[RFC PATCH 3/4] spi: spi-fsl-spi: allow changing bits_per_word while CS is still active

2019-03-27 Thread Rasmus Villemoes
won't appear. The purpose of this change is to allow automatically optimizing large transfers to use 32 bits-per-word; taking one interrupt for every byte is extremely slow. Signed-off-by: Rasmus Villemoes --- drivers/spi/spi-fsl-spi.c | 11 ++- 1 file changed, 6 insertions(+), 5 dele

[RFC PATCH 1/4] spi: spi-fsl-spi: remove always-true conditional in fsl_spi_do_one_msg

2019-03-27 Thread Rasmus Villemoes
__spi_validate() in the generic SPI code sets ->speed_hz and ->bits_per_word to non-zero values, so this condition is always true. Signed-off-by: Rasmus Villemoes --- This of course relies on no spi_message reaching ->transfer_one_message without having been through __spi_validate.

[RFC PATCH 2/4] spi: spi-fsl-spi: relax message sanity checking a little

2019-03-27 Thread Rasmus Villemoes
we can change it to follow the same logic as is used by the actual transfer loop. Signed-off-by: Rasmus Villemoes --- drivers/spi/spi-fsl-spi.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c index 6d114daa1

[RFC PATCH 0/4] spi: spi-fsl-spi: try to make cpu-mode transfers faster

2019-03-27 Thread Rasmus Villemoes
e not observed any problems, but to completely rule out the possibility of "glitches on SPI CLK" mentioned in patch 3 would of course require testing on a much wider set of hardware combinations. Rasmus Villemoes (4): spi: spi-fsl-spi: remove always-true conditional in fsl_spi_do_one_msg s

[RFC PATCH 4/4] spi: spi-fsl-spi: automatically adapt bits-per-word in cpu mode

2019-03-27 Thread Rasmus Villemoes
tra fsl_spi_setup_transfer() calls this causes. Signed-off-by: Rasmus Villemoes --- drivers/spi/spi-fsl-spi.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c index e2b341943796..b36ac6aa3b1f 100644 --- a/drivers/spi/spi-fsl-sp

Re: [PATCH v2 1/6] leds: netdev trigger: use memcpy in device_name_store

2019-03-27 Thread Rasmus Villemoes
On 26/03/2019 20.53, Jacek Anaszewski wrote: > Hi Rasmus, > > Thank you for the patch. > > On 3/14/19 3:06 PM, Rasmus Villemoes wrote: >> If userspace doesn't end the input with a newline (which can easily >> happen if the write happens from a C program that does

Re: [PATCH v2 1/6] leds: netdev trigger: use memcpy in device_name_store

2019-03-27 Thread Rasmus Villemoes
On 27/03/2019 22.20, Jacek Anaszewski wrote: > Thanks for the heads-up. I must admit I'm hitting into that for the > first time. After "git am" it was all OK, but it got screwed up after > "git rebase -i". And having "commit.cleanup = scissors" set globally all > the time is annoying if one extens

Re: PATCH 2/2] lib/bitmap.c: guard exotic bitmap functions by CONFIG_NUMA

2019-04-01 Thread Rasmus Villemoes
On 30/03/2019 19.54, Yury Norov wrote: > Hi Rasmus! > >> From: Rasmus Villemoes >> Sent: Saturday, March 30, 2019 12:53:51 AM >> To: Rasmus Villemoes; Andrew Morton; Andy Shevchenko >> Cc: Yury Norov; linux-kernel@vger.kernel.org >> Subject: [PATCH 2/

Re: [RFCv2] string: Use faster alternatives when constant arguments are used

2019-04-01 Thread Rasmus Villemoes
On 30/03/2019 23.59, Sultan Alsawaf wrote: > How can the memcmps cross a page boundary when memcmp itself will > only read in large buffers of data at word boundaries? Consider your patch replacing !strcmp(buf, "123") by !memcmp(buf, "123", 4). buf is known to point to a nul-terminated string. But

Re: [PATCH 0/5] simple sort swap function usage improvements

2019-04-01 Thread Rasmus Villemoes
[trimming cc list] On 30/03/2019 18.16, George Spelvin wrote: > Great work; that is indeed a logical follow-on. > > Reviewed by: George Spelvin > > I you feel even more ambitious, you could try impementing Rasmus > Villemoes' idea of having generic *compare* function

Re: [RFCv2] string: Use faster alternatives when constant arguments are used

2019-04-02 Thread Rasmus Villemoes
On 02/04/2019 01.55, Sultan Alsawaf wrote: > On Mon, Apr 01, 2019 at 10:43:13PM +0200, Rasmus Villemoes wrote: >> No. First, these are concerns for all arches. Second, if you can find >> some particular place where string parsing/matching is in any way >> performance relev

Re: [RFC PATCH 0/4] spi: spi-fsl-spi: try to make cpu-mode transfers faster

2019-04-02 Thread Rasmus Villemoes
On 01/04/2019 09.34, Mark Brown wrote: > On Wed, Mar 27, 2019 at 02:30:48PM +0000, Rasmus Villemoes wrote: >> I doubt patches 3 and 4 are acceptable, but I'd still like to get >> comments and/or alternative suggestions for making large transfers >> faster. > > I

Re: [patch 15/14] x86/dumpstack/64: Speedup in_exception_stack()

2019-04-02 Thread Rasmus Villemoes
On 02/04/2019 17.48, Thomas Gleixner wrote: > On Tue, 2 Apr 2019, Josh Poimboeuf wrote: >> On Tue, Apr 02, 2019 at 12:19:46PM +0200, Thomas Gleixner wrote: >>> +/* >>> + * Array of exception stack page descriptors. If the stack is larger than >>> + * PAGE_SIZE, all pages covering a particular stack

Re: [PATCH v2] ubsan: Avoid unnecessary 128-bit shifts

2019-04-02 Thread Rasmus Villemoes
On 03/04/2019 07.45, George Spelvin wrote: > > diff --git a/lib/ubsan.c b/lib/ubsan.c > index e4162f59a81c..a7eb55fbeede 100644 > --- a/lib/ubsan.c > +++ b/lib/ubsan.c > @@ -89,8 +89,8 @@ static bool is_inline_int(struct type_descriptor *type) > static s_max get_signed_val(struct type_descriptor

Re: [PATCH 1/5] lib: make bitmap_parselist_user() a wrapper on bitmap_parselist()

2019-04-03 Thread Rasmus Villemoes
On 03/04/2019 13.17, Andy Shevchenko wrote: > On Wed, Apr 03, 2019 at 02:15:22PM +0300, Andy Shevchenko wrote: >> On Wed, Apr 03, 2019 at 07:45:36AM +0300, Yury Norov wrote: >>> Currently we parse user data byte after byte which leads to >>> overcomplification of parsing algorithm. The only user of

Re: [PATCH v1 bitops] bitops: Fix UBSAN undefined behavior warning for rotation right

2019-04-09 Thread Rasmus Villemoes
On 09/04/2019 00.52, Andrew Morton wrote: > (resend, cc Andrey) > > On Sun, 7 Apr 2019 12:53:25 + Vadim Pasternak > wrote: > >> The warning is caused by call to rorXX(), if the second parameters of >> this function "shift" is zero. In such case UBSAN reports the warning >> for the next exp

Re: [PATCH v1 bitops] bitops: Fix UBSAN undefined behavior warning for rotation right

2019-04-09 Thread Rasmus Villemoes
On 09/04/2019 10.08, Rasmus Villemoes wrote: > one could do > > u32 ror32(u32 x, unsigned s) > { > return (x >> (s&31)) | (x << ((32-s)&31)); > } > > to make the shifts always well-defined and also work as expected for s > >= 32... if onl

[PATCH 04/10] dynamic_debug: introduce accessors for string members of struct _ddebug

2019-04-09 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 03/10] linux/printk.h: use unique identifier for each struct _ddebug

2019-04-09 Thread Rasmus Villemoes
: 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 d7c77ed1a4cb..0fcc588db649 100644 --- a/include/linux

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

2019-04-09 Thread Rasmus Villemoes
: 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

[PATCH 09/10] arm64: select DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-04-09 Thread Rasmus Villemoes
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 05/10] dynamic_debug: drop use of bitfields in struct _ddebug

2019-04-09 Thread Rasmus Villemoes
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

[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
e fun 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

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

2019-04-09 Thread Rasmus Villemoes
eed 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/Kcon

[PATCH 06/10] dynamic_debug: introduce CONFIG_DYNAMIC_DEBUG_RELATIVE_POINTERS

2019-04-09 Thread Rasmus Villemoes
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

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 c

[PATCH] bitops.h: sanitize rotate primitives

2019-04-10 Thread Rasmus Villemoes
d for shifts 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 --

Re: [PATCH 5/6] lib: Fix function documentation for strncpy_from_user

2019-02-25 Thread Rasmus Villemoes
On 22/02/2019 00.03, Kees Cook wrote: > On Thu, Feb 21, 2019 at 6:58 AM Rasmus Villemoes > wrote: >> >> On 21/02/2019 07.02, Kees Cook wrote: >> > >>> ... snprintf returns what it WOULD have written, much like strlcpy >>> above. At least snprintf

[RFC PATCH] soc/fsl/qe: support MPC8309

2019-02-26 Thread Rasmus Villemoes
from DT. Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c index 2ef6fc6487c1..185da4be3509 100644 --- a/drivers/soc/fsl/qe/qe.c +++ b/drivers/soc/fsl/qe/qe.c @@ -306,12 +

[PATCH] kbuild: add CONFIG_VMLINUX_MAP expert option

2021-02-24 Thread Rasmus Villemoes
an be rather large (several MB), and that's a waste of space when one isn't interested in these things. Also hide the prompt behind CONFIG_EXPERT. Signed-off-by: Rasmus Villemoes --- .gitignore | 1 + Makefile| 3 ++- lib/Kconfig.debug | 9

[PATCH/RFC 0/2] background initramfs unpacking, and CONFIG_MODPROBE_PATH

2021-02-24 Thread Rasmus Villemoes
s with a custom-made .config and initramfs can boot faster, partly due to utilizing more than one cpu earlier, partly by avoiding known-futile modprobe calls (which would still trigger synchronization with the initramfs unpacking, thus eliminating most of the first benefit). Rasmus Villemoes (2)

[PATCH/RFC 1/2] init/initramfs.c: allow asynchronous unpacking

2021-02-24 Thread Rasmus Villemoes
ystem directly and not via one of the official kernel interfaces (i.e. request_firmware*(), call_usermodehelper*) that theory may not hold - also, I certainly might have missed a spot when sprinkling wait_for_initramfs(). Signed-off-by: Rasmus Villemoes --- .../admin-guide/kernel-parameter

[PATCH/RFC 2/2] modules: add CONFIG_MODPROBE_PATH

2021-02-24 Thread Rasmus Villemoes
to-be-futile) calls of usermodehelper, the initramfs unpacking and the {device,late}_initcalls can proceed in parallel for much longer. [1] __request_module() already has an early -ENOENT return when modprobe_path is the empty string. Signed-off-by: Rasmus Villemoes --- init/Kconfig

Re: [GIT PULL] Modules updates for v5.12

2021-02-24 Thread Rasmus Villemoes
On 24/02/2021 15.40, Masahiro Yamada wrote: > On Wed, Feb 24, 2021 at 5:33 PM Jessica Yu wrote: >> >> +++ Linus Torvalds [23/02/21 12:03 -0800]: >>> On Tue, Feb 23, 2021 at 12:01 PM Christoph Hellwig wrote: Does your build now enable TRIM_UNUSED_KSYMS but previously didn't by chanc

Re: [PATCH/RFC 1/2] init/initramfs.c: allow asynchronous unpacking

2021-02-24 Thread Rasmus Villemoes
On 24/02/2021 18.17, Linus Torvalds wrote: > On Wed, Feb 24, 2021 at 6:29 AM Rasmus Villemoes > wrote: >> >> So add an initramfs_async= kernel parameter, allowing the main init >> process to proceed to handling device_initcall()s without waiting for >> populate_root

Re: [PATCH/RFC 0/2] background initramfs unpacking, and CONFIG_MODPROBE_PATH

2021-02-24 Thread Rasmus Villemoes
On 24/02/2021 15.29, Rasmus Villemoes wrote: > These two patches are independent, but better-together. kernel test robot says I'll have to add a 0/2 patch: linux/initrd.h: grow an include guard [because defining a macro a second time with the same contents is ok, so is doing anothe

Re: [PATCH v4 0/8] support for bitmap (and hence CPU) list "N" abbreviation

2021-02-11 Thread Rasmus Villemoes
On 10/02/2021 18.57, Paul E. McKenney wrote: > On Wed, Feb 10, 2021 at 06:26:54PM +0200, Andy Shevchenko wrote: >> On Tue, Feb 09, 2021 at 05:58:59PM -0500, Paul Gortmaker wrote: >>> The basic objective here was to add support for "nohz_full=8-N" and/or >>> "rcu_nocbs="4-N" -- essentially introduce

Re: [PATCH 04/14] lib: introduce BITS_{FIRST,LAST} macro

2021-02-18 Thread Rasmus Villemoes
On 18/02/2021 05.05, Yury Norov wrote: > BITMAP_{LAST,FIRST}_WORD_MASK() in linux/bitmap.h duplicates the > functionality of GENMASK(). The scope of there macros is wider > than just bitmap. This patch defines 4 new macros: BITS_FIRST(), > BITS_LAST(), BITS_FIRST_MASK() and BITS_LAST_MASK() in linu

Re: [PATCH 06/14] bitsperlong.h: introduce SMALL_CONST() macro

2021-02-18 Thread Rasmus Villemoes
On 18/02/2021 05.05, Yury Norov wrote: > Many algorithms become simpler if they are passed with relatively small > input values. One example is bitmap operations when the whole bitmap fits > into one word. To implement such simplifications, linux/bitmap.h declares > small_const_nbits() macro. > >

[PATCH] spi: fsl: invert spisel_boot signal on MPC8309

2021-01-30 Thread Rasmus Villemoes
gle "spo", special-purpose output). Fixes: 7a2da5d7960a ("spi: fsl: Fix driver breakage when SPI_CS_HIGH is not set in spi->mode") Cc: sta...@vger.kernel.org Signed-off-by: Rasmus Villemoes --- drivers/spi/spi-fsl-spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH net-next v2 0/4] bridge: mrp: Extend br_mrp_switchdev_*

2021-02-01 Thread Rasmus Villemoes
On 30/01/2021 04.01, Jakub Kicinski wrote: > On Wed, 27 Jan 2021 21:52:37 +0100 Horatiu Vultur wrote: >> This patch series extends MRP switchdev to allow the SW to have a better >> understanding if the HW can implement the MRP functionality or it needs >> to help the HW to run it. There are 3 cases

Re: [PATCH net 2/2] switchdev: mrp: Remove SWITCHDEV_ATTR_ID_MRP_PORT_STAT

2021-02-08 Thread Rasmus Villemoes
chdev API to offload MRP") > Signed-off-by: Horatiu Vultur Acked-by: Rasmus Villemoes

Re: [PATCH net 1/2] bridge: mrp: Fix the usage of br_mrp_port_switchdev_set_state

2021-02-08 Thread Rasmus Villemoes
th the switchdev API") > Fixes: fadd409136f0f2 ("bridge: switchdev: mrp: Implement MRP API for > switchdev") > Fixes: 2f1a11ae11d222 ("bridge: mrp: Add MRP interface.") > Reported-by: Rasmus Villemoes > Signed-off-by: Horatiu Vultur > --- Tested-by: Rasmus Villemoes

Re: [GIT PULL] Modules updates for v5.12

2021-02-25 Thread Rasmus Villemoes
On 25/02/2021 16.49, Masahiro Yamada wrote: > On Thu, Feb 25, 2021 at 4:36 AM Rasmus Villemoes > wrote: >> >> On 24/02/2021 15.40, Masahiro Yamada wrote: > > > Good insight. > Actually, I came up with the same idea last night, and had started > the implementa

spdx spring cleaning

2021-02-26 Thread Rasmus Villemoes
Hi, I was doing some 'git grep SPDX-License-Identifier' statistics, but noticed that I had to do a lot more normalization than expected (clearly handling different comment markers is needed). How about running something like the below after -rc1? The end result is 2558 files changed, 2558 inser

[PATCH] kernel/async.c: fix pr_debug statement

2021-02-26 Thread Rasmus Villemoes
An async_func_t returns void - any errors encountered it has to stash somewhere for consumers to discover later. Signed-off-by: Rasmus Villemoes --- kernel/async.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/async.c b/kernel/async.c index 33258e6e20f8

Re: spdx spring cleaning

2021-02-26 Thread Rasmus Villemoes
On 26/02/2021 13.58, Greg Kroah-Hartman wrote: > What exactly are you trying to "clean up" here? For example, just inside Documentation/devicetree/bindings/display/panel/, the exact same thing is expressed in four different ways: (GPL-2.0-only or BSD-2-Clause) GPL-2.0-only or BSD-2-Clause (GPL-

[PATCH 0/2] add ripple counter dt binding and driver

2021-02-26 Thread Rasmus Villemoes
in DT and have a driver do the clk_prepare_enable(), even if that driver doesn't and can't do anything else. But I'm certainly open to other suggestions. The "clk_ignore_unused" kernel parameter is fine for debugging, but too big a hammer (since it applies to all "unused" cloc

[PATCH 1/2] dt-bindings: misc: add binding for generic ripple counter

2021-02-26 Thread Rasmus Villemoes
. Signed-off-by: Rasmus Villemoes --- Documentation/devicetree/bindings/misc/ripple-ctr.txt | 8 1 file changed, 8 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/ripple-ctr.txt diff --git a/Documentation/devicetree/bindings/misc/ripple-ctr.txt b/Documentation

[PATCH 2/2] drivers: misc: add ripple counter driver

2021-02-26 Thread Rasmus Villemoes
The only purpose of this driver is to serve as a consumer of the input clock, to prevent it from being disabled by clk_disable_unused(). Signed-off-by: Rasmus Villemoes --- drivers/misc/Kconfig | 7 +++ drivers/misc/Makefile | 1 + drivers/misc/ripple-ctr.c | 31

Re: [PATCH 0/2] add ripple counter dt binding and driver

2021-02-26 Thread Rasmus Villemoes
On 26/02/2021 15.35, Arnd Bergmann wrote: > On Fri, Feb 26, 2021 at 3:14 PM Rasmus Villemoes > wrote: > >> >> So I'm thinking that the proper way to handle this is to be able to >> represent that ripple counter as a clock consumer in DT and have a >> drive

Re: [PATCH linux-5.2.y-rt only] hrtimer: correct the logic for grab expiry lock

2020-08-12 Thread Rasmus Villemoes
On 12/08/2020 12.50, zhantao.t...@windriver.com wrote: > From: Zhantao Tang > > In commit: 47b6de0b7f22 ("hrtimer: Add a missing bracket and hide > `migration_base' on !SMP") > a inline function is_migration_base() is introduced. But > the logic of the hrtimer_grab_expiry_lock was changed. > >

Re: [PATCH] overflow: Add __must_check attribute to check_*() helpers

2020-08-12 Thread Rasmus Villemoes
tatic inline that is marked with __must_check. This means > the macros can continue to have their type-agnostic behavior while gaining > the function attribute (that cannot be applied directly to macros). > > Suggested-by: Rasmus Villemoes > Signed-off-by: Kees Cook > --- &g

Re: [PATCH 0/4] -ffreestanding/-fno-builtin-* patches

2020-08-20 Thread Rasmus Villemoes
On 18/08/2020 23.41, Arvind Sankar wrote: > On Tue, Aug 18, 2020 at 01:58:51PM -0700, Nick Desaulniers wrote: >> On Tue, Aug 18, 2020 at 1:27 PM Nick Desaulniers >> wrote: >>> >>> On Tue, Aug 18, 2020 at 1:24 PM Arvind Sankar wrote: On Tue, Aug 18, 2020 at 12:13:22PM -0700, Linus Torval

Re: [RFC] saturate check_*_overflow() output?

2020-08-05 Thread Rasmus Villemoes
On 04/08/2020 21.23, Kees Cook wrote: > On Tue, Aug 04, 2020 at 08:11:45AM +0200, Rasmus Villemoes wrote: >> What we might do, to deal with the "caller fails to check the result", >> is to add a >> >> static inline bool __must_check must_check_overflow(bool b)

[PATCH v2 0/3] add reset-source RTC binding, update pcf2127 driver

2020-12-11 Thread Rasmus Villemoes
This is a resend of Uwe's pcf2127 patches, prepended by a dt-binding patch adding a reset-source property, as suggested by Alexandre. Rasmus Villemoes (1): dt-bindings: rtc: add reset-source property Uwe Kleine-König (2): rtc: pcf2127: move watchdog initialisation to a separate fun

[PATCH v2 1/3] dt-bindings: rtc: add reset-source property

2020-12-11 Thread Rasmus Villemoes
ar to wakeup-source. Suggested-by: Alexandre Belloni Signed-off-by: Rasmus Villemoes --- Documentation/devicetree/bindings/rtc/rtc.yaml | 5 + 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/rtc/rtc.yaml b/Documentation/devicetree/bindings/rtc/rtc.yaml

[PATCH v2 3/3] rtc: pcf2127: only use watchdog when explicitly available

2020-12-11 Thread Rasmus Villemoes
the device tree has a "reset-source" property. Signed-off-by: Uwe Kleine-König [RV: s/has-watchdog/reset-source/] Signed-off-by: Rasmus Villemoes --- drivers/rtc/rtc-pcf2127.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-pcf2127.c b/drivers/rtc

[PATCH v2 2/3] rtc: pcf2127: move watchdog initialisation to a separate function

2020-12-11 Thread Rasmus Villemoes
#ifdefery Signed-off-by: Uwe Kleine-König [RV: check return value of pcf2127_watchdog_init(), per Bruno] Signed-off-by: Rasmus Villemoes --- drivers/rtc/rtc-pcf2127.c | 54 ++- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/drivers/rtc/rtc-pcf2127

Re: [PATCH v2 1/3] dt-bindings: rtc: add reset-source property

2020-12-11 Thread Rasmus Villemoes
On 11/12/2020 23.30, Rob Herring wrote: > On Fri, Dec 11, 2020 at 3:56 PM Rasmus Villemoes > wrote: >> >> Some RTCs, e.g. the pcf2127, can be used as a hardware watchdog. But >> if the reset pin is not actually wired up, the driver exposes a >> watchdog dev

Re: [PATCH] dt-bindings: rtc: pcf2127: update bindings

2020-12-21 Thread Rasmus Villemoes
On 19/12/2020 02.34, Alexandre Belloni wrote: > pcf2127, pcf2129 and pca2129 support start-year and reset-source. > No, the 2129 variant doesn't even have a reset output pin. Not sure if there's any way to reflect that, and it probably doesn't matter, since nobody's going to add the reset-source

[PATCH net 2/2] net: switchdev: don't set port_obj_info->handled true when -EOPNOTSUPP

2020-12-23 Thread Rasmus Villemoes
hdev_port_obj_notify() can propagate that information. Signed-off-by: Rasmus Villemoes --- net/switchdev/switchdev.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 23d868545362..2c1ffc9ba2eb 100

[PATCH net 0/2] MRP without hardware offload?

2020-12-23 Thread Rasmus Villemoes
chip-ung/mrp.git and kernel v5.10.2. Rasmus Villemoes (2): net: mrp: fix definitions of MRP test packets net: switchdev: don't set port_obj_info->handled true when -EOPNOTSUPP include/uapi/linux/mrp_bridge.h | 4 ++-- net/switchdev/switchdev.c | 23 +-- 2 fi

[PATCH net 1/2] net: mrp: fix definitions of MRP test packets

2020-12-23 Thread Rasmus Villemoes
ehind a +1000$ paywall can be called a standard. Signed-off-by: Rasmus Villemoes --- include/uapi/linux/mrp_bridge.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/mrp_bridge.h b/include/uapi/linux/mrp_bridge.h index 6aeb13ef0b1e..d1d0cf65916d 100644 -

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

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 the te

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 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 -

Re: [PATCH 0/2] net: dsa: mv88e6xxx: fix vlan filtering for 6250

2021-01-18 Thread Rasmus Villemoes
On 17/01/2021 22.08, Vladimir Oltean wrote: > Hi Rasmus, > > On Sat, Jan 16, 2021 at 03:39:34AM +0100, Rasmus Villemoes wrote: >> I finally managed to figure out why enabling VLAN filtering on the >> 6250 broke all (ingressing) traffic, >> cf. >> https://lore.ker

[PATCH net] net: mrp: use stp state as substitute for unimplemented mrp state

2021-01-18 Thread Rasmus Villemoes
with that. Signed-off-by: Rasmus Villemoes --- I don't really understand why SWITCHDEV_ATTR_ID_MRP_PORT_STATE even has to exist seperately from SWITCHDEV_ATTR_ID_PORT_STP_STATE, and it's hard to tell what the difference might be since no kernel code implements the former.

Re: [PATCH net 1/2] net: mrp: fix definitions of MRP test packets

2021-01-19 Thread Rasmus Villemoes
On 28/12/2020 23.24, Jakub Kicinski wrote: > On Wed, 23 Dec 2020 15:45:32 +0100 Rasmus Villemoes wrote: >> Wireshark says that the MRP test packets cannot be decoded - and the >> reason for that is that there's a two-byte hole filled with garbage >> between the &q

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