[PATCH] docs: admin-guide: update description for kernel.modprobe sysctl

2021-04-20 Thread Rasmus Villemoes
When I added CONFIG_MODPROBE_PATH, I neglected to update Documentation/. It's still true that this defaults to /sbin/modprobe, but now via a level of indirection. So document that the kernel might have been built with something other than /sbin/modprobe as the initial value. Signed-off-by: R

[PATCH] docs: admin-guide: update description for kernel.hotplug sysctl

2021-04-20 Thread Rasmus Villemoes
uot;Driver-Core: disable /sbin/hotplug by default") Signed-off-by: Rasmus Villemoes --- Documentation/admin-guide/sysctl/kernel.rst | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rs

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 the

[PATCH] driver core: make device_set_deferred_probe_reason a no-op when !CONFIG_DEBUG_FS

2021-04-19 Thread Rasmus Villemoes
loc()) for the minimal amount of ifdeffery. Signed-off-by: Rasmus Villemoes --- drivers/base/dd.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 37a5e5f8b221..6a197336c6a4 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -216,9 +216,

Re: [PATCH 05/15] x86: Implement function_nocfi

2021-04-19 Thread Rasmus Villemoes
On 17/04/2021 00.28, Kees Cook wrote: > On Fri, Apr 16, 2021 at 03:06:17PM -0700, Andy Lutomirski wrote: >> The >> foo symbol would point to whatever magic is needed. > > No, the symbol points to the jump table entry. Direct calls get minimal > overhead and indirect calls can add the "is this fun

Re: [PATCH v5] printk: Userspace format enumeration support

2021-04-19 Thread Rasmus Villemoes
On 16/04/2021 15.56, Chris Down wrote: > Hey Petr, Rasmus, >> This is great point! There are many other subsystem specific wrappers, >> e,g, ata_dev_printk(), netdev_printk(), snd_printk(), dprintk(). >> We should make it easy to index them as well. > > These would be nice to have, but we should

Re: [PATCH 1/2] workqueue: Have 'alloc_workqueue()' like macros accept a format specifier

2021-04-18 Thread Rasmus Villemoes
On 18/04/2021 23.26, Christophe JAILLET wrote: > Improve 'create_workqueue', 'create_freezable_workqueue' and > 'create_singlethread_workqueue' so that they accept a format > specifier and a variable number of arguments. > > This will put these macros more in line with 'alloc_ordered_workqueue' an

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 v6 01/27] mm: Introduce struct folio

2021-04-08 Thread Rasmus Villemoes
On 31/03/2021 20.47, Matthew Wilcox (Oracle) wrote: > +static inline void folio_build_bug(void) > +{ > +#define FOLIO_MATCH(pg, fl) \ > +BUILD_BUG_ON(offsetof(struct page, pg) != offsetof(struct folio, fl)); > + > + FOLIO_MATCH(flags, flags); > + FO

Re: [greybus-dev] [PATCH] greybus: remove stray nul byte in apb_log_enable_read output

2021-03-26 Thread Rasmus Villemoes
On 26/03/2021 17.31, Alex Elder wrote: > On 3/26/21 10:22 AM, Rasmus Villemoes wrote: >> Including a nul byte in the otherwise human-readable ascii output >> from this debugfs file is probably not intended. > > Looking only at the comments above simple_read_from_buffer(), &

[PATCH] greybus: remove stray nul byte in apb_log_enable_read output

2021-03-26 Thread Rasmus Villemoes
Including a nul byte in the otherwise human-readable ascii output from this debugfs file is probably not intended. Signed-off-by: Rasmus Villemoes --- drivers/greybus/es2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/greybus/es2.c b/drivers/greybus/es2.c index

[PATCH] debugfs: drop pointless nul-termination in debugfs_read_file_bool()

2021-03-26 Thread Rasmus Villemoes
simple_read_from_buffer() doesn't care about any bytes in the buffer beyond "available". Making the buffer nul-terminated is therefore completely pointless. Signed-off-by: Rasmus Villemoes --- fs/debugfs/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --g

Re: [PATCH v2 6/9] debugfs: Implement debugfs_create_str()

2021-03-26 Thread Rasmus Villemoes
On 26/03/2021 15.22, Peter Zijlstra wrote: > On Fri, Mar 26, 2021 at 01:53:59PM +0100, Rasmus Villemoes wrote: >> On 26/03/2021 12.38, Peter Zijlstra wrote: > >>> + >>> +again: >>> + rcu_read_lock(); >>> + str = rcu_dereference(*(char **)fi

Re: [PATCH v2 6/9] debugfs: Implement debugfs_create_str()

2021-03-26 Thread Rasmus Villemoes
On 26/03/2021 13.57, Greg KH wrote: > On Fri, Mar 26, 2021 at 01:53:59PM +0100, Rasmus Villemoes wrote: >> On 26/03/2021 12.38, Peter Zijlstra wrote: >> >>> Implement debugfs_create_str() to easily display names and such in >>> debugfs. >> >> Patches 7-

Re: [PATCH v2 6/9] debugfs: Implement debugfs_create_str()

2021-03-26 Thread Rasmus Villemoes
On 26/03/2021 12.38, Peter Zijlstra wrote: > Implement debugfs_create_str() to easily display names and such in > debugfs. Patches 7-9 don't seem to add any users of this. What's it for precisely? > + > +again: > + rcu_read_lock(); > + str = rcu_dereference(*(char **)file->private_data);

[tip: sched/core] sched/core: Use -EINVAL in sched_dynamic_mode()

2021-03-25 Thread tip-bot2 for Rasmus Villemoes
The following commit has been merged into the sched/core branch of tip: Commit-ID: c4681f3f1cfcfde0c95ff72f0bdb43f9ffd7f00e Gitweb: https://git.kernel.org/tip/c4681f3f1cfcfde0c95ff72f0bdb43f9ffd7f00e Author:Rasmus Villemoes AuthorDate:Thu, 25 Mar 2021 01:45:15 +01:00

[tip: sched/core] sched/core: Stop using magic values in sched_dynamic_mode()

2021-03-25 Thread tip-bot2 for Rasmus Villemoes
The following commit has been merged into the sched/core branch of tip: Commit-ID: 7e1b2eb74928b2478fd0630ce6c664334b480d00 Gitweb: https://git.kernel.org/tip/7e1b2eb74928b2478fd0630ce6c664334b480d00 Author:Rasmus Villemoes AuthorDate:Thu, 25 Mar 2021 01:45:14 +01:00

Re: [PATCH] static_call: fix function type mismatch

2021-03-25 Thread Rasmus Villemoes
On 25/03/2021 08.42, Peter Zijlstra wrote: > On Thu, Mar 25, 2021 at 01:42:41AM +0100, Rasmus Villemoes wrote: >>> Actually, it looks like I can't select PREEMPT_DYNAMIC> and tweaking Kconfig >> >> Ah, there's no prompt on the "bool" line, so it

[PATCH 2/2] sched: use -EINVAL in sched_dynamic_mode

2021-03-24 Thread Rasmus Villemoes
-1 is -EPERM which is a somewhat odd error to return from sched_dynamic_write(). No other callers care about which negative value is used. Signed-off-by: Rasmus Villemoes --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel

[PATCH 1/2] sched: stop using magic values in sched_dynamic_mode

2021-03-24 Thread Rasmus Villemoes
Use the enum names which are also what is used in the switch() in sched_dynamic_update(). Signed-off-by: Rasmus Villemoes --- kernel/sched/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 98191218d891..3959481261bb

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Rasmus Villemoes
On 25/03/2021 00.40, Sami Tolvanen wrote: > On Wed, Mar 24, 2021 at 3:53 PM Rasmus Villemoes > wrote: >> >> On 24/03/2021 23.34, Sami Tolvanen wrote: >>> On Wed, Mar 24, 2021 at 2:51 PM Rasmus Villemoes >>> wrote: >>>> >>>> On 24/03/202

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Rasmus Villemoes
On 24/03/2021 23.34, Sami Tolvanen wrote: > On Wed, Mar 24, 2021 at 2:51 PM Rasmus Villemoes > wrote: >> >> On 24/03/2021 18.33, Peter Zijlstra wrote: >>> On Wed, Mar 24, 2021 at 05:45:52PM +0100, Rasmus Villemoes wrote: >>>> Sorry, I think I misrea

Re: [RFC patch] vsprintf: Allow %pe to print non PTR_ERR %pe uses as decimal

2021-03-24 Thread Rasmus Villemoes
On 24/03/2021 23.18, Joe Perches wrote: > On Wed, 2021-03-24 at 22:27 +0100, Rasmus Villemoes wrote: >> On 24/03/2021 20.24, Joe Perches wrote: >>> On Wed, 2021-03-24 at 18:33 +0100, Rasmus Villemoes wrote: >>>> On 24/03/2021 18.20, Joe Perches wrote: >>>&g

Re: [PATCH v2 04/12] module: Add printk format to add module build ID to stacktraces

2021-03-24 Thread Rasmus Villemoes
On 24/03/2021 20.11, Stephen Boyd wrote: > Quoting Rasmus Villemoes (2021-03-24 02:57:13) >> >> Is there any reason you didn't just make b an optional flag that could >> be specified with or without R? I suppose the parsing is more difficult >> with several orth

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Rasmus Villemoes
On 24/03/2021 18.33, Peter Zijlstra wrote: > On Wed, Mar 24, 2021 at 05:45:52PM +0100, Rasmus Villemoes wrote: >> Sorry, I think I misread the code. The static calls are indeed >> initialized with a function with the right prototype. Try adding >> "preempt=full"

Re: [RFC patch] vsprintf: Allow %pe to print non PTR_ERR %pe uses as decimal

2021-03-24 Thread Rasmus Villemoes
On 24/03/2021 20.24, Joe Perches wrote: > On Wed, 2021-03-24 at 18:33 +0100, Rasmus Villemoes wrote: >> On 24/03/2021 18.20, Joe Perches wrote: >> >>> >>> Maybe it's better to output non PTR_ERR %pe uses as decimal so this >>> sort of code would work

Re: [RFC patch] vsprintf: Allow %pe to print non PTR_ERR %pe uses as decimal

2021-03-24 Thread Rasmus Villemoes
On 24/03/2021 18.20, Joe Perches wrote: > On Wed, 2021-03-24 at 09:52 -0700, Joe Perches wrote: >> On Wed, 2021-03-24 at 17:42 +0100, Arnd Bergmann wrote: >>> On Wed, Mar 24, 2021 at 3:20 PM Joe Perches wrote: >> [] > diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c >

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Rasmus Villemoes
On 24/03/2021 17.01, Sami Tolvanen wrote: > On Wed, Mar 24, 2021 at 5:46 AM Rasmus Villemoes > wrote: >> >> On 23/03/2021 08.47, Peter Zijlstra wrote: >>> On Mon, Mar 22, 2021 at 05:29:21PM -0400, Steven Rostedt wrote: >>>> On Mon, 22 Mar 2021 2

Re: [PATCH v3 02/17] cfi: add __cficanonical

2021-03-24 Thread Rasmus Villemoes
On 23/03/2021 21.39, Sami Tolvanen wrote: > With CONFIG_CFI_CLANG, the compiler replaces a function address taken > in C code with the address of a local jump table entry, which passes > runtime indirect call checks. However, the compiler won't replace > addresses taken in assembly code, which will

Re: [PATCH] amdgpu: fix gcc -Wrestrict warning

2021-03-24 Thread Rasmus Villemoes
On 24/03/2021 14.33, Arnd Bergmann wrote: > On Tue, Mar 23, 2021 at 4:57 PM Rasmus Villemoes > wrote: >> On 23/03/2021 14.04, Arnd Bergmann wrote: >>> if (securedisplay_cmd->status == >>> TA_SECUREDISPLAY_STATUS__SUCCESS) { >>>

Re: [PATCH] [v2] hinic: avoid gcc -Wrestrict warning

2021-03-24 Thread Rasmus Villemoes
-qualified argument 1 was declared here > 464 | char set_link_str[SET_LINK_STR_MAX_LEN] = {0}; > > Rewrite this to avoid the nested sprintf and instead use separate > buffers, which is simpler. > This looks much better. Thanks. > Cc: Rasmus Villemoes > Signed-off-by: Arnd Be

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Rasmus Villemoes
On 23/03/2021 08.47, Peter Zijlstra wrote: > On Mon, Mar 22, 2021 at 05:29:21PM -0400, Steven Rostedt wrote: >> On Mon, 22 Mar 2021 22:18:17 +0100 >> Arnd Bergmann wrote: >> >>> I think the code works correctly on all architectures we support because >>> both 'int' and 'long' are returned in a reg

Re: [PATCH v2] editorconfig: Add automatic editor configuration file

2021-03-24 Thread Rasmus Villemoes
On 03/07/2020 14.29, Jonathan Corbet wrote: [doing a bit of necromancy here] > On Fri, 3 Jul 2020 00:31:43 -0700 > Danny Lin wrote: > >> EditorConfig is a standard for defining basic editor configuration in >> projects. There is support available for 47 code editors as of writing, >> including

Re: [PATCH v2 04/12] module: Add printk format to add module build ID to stacktraces

2021-03-24 Thread Rasmus Villemoes
On 24/03/2021 03.04, Stephen Boyd wrote: > @@ -2778,6 +2793,10 @@ static inline void layout_symtab(struct module *mod, > struct load_info *info) > static void add_kallsyms(struct module *mod, const struct load_info *info) > { > } > + > +static void init_build_id(struct module *mod, const struc

Re: [PATCH v2 02/12] buildid: Add method to get running kernel's build ID

2021-03-24 Thread Rasmus Villemoes
On 24/03/2021 03.04, Stephen Boyd wrote: > Add vmlinux_build_id() so that callers can print a hex format string > representation of the running kernel's build ID. This will be used in > the kdump and dump_stack code so that developers can easily locate the > vmlinux debug symbols for a crash/stackt

Re: [PATCH net-next] hinic: avoid gcc -Wrestrict warning

2021-03-23 Thread Rasmus Villemoes
On 23/03/2021 13.56, Arnd Bergmann wrote: > From: Arnd Bergmann > > With extra warnings enabled, gcc complains that snprintf should not > take the same buffer as source and destination: > > drivers/net/ethernet/huawei/hinic/hinic_ethtool.c: In function > 'hinic_set_settings_to_hw': > drivers/ne

Re: [kbuild-all] Re: include/linux/compiler_types.h:315:38: error: call to '__compiletime_assert_536' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct can_frame, len) != offsetof(st

2021-03-23 Thread Rasmus Villemoes
On 23/03/2021 19.59, Oliver Hartkopp wrote: > > > On 23.03.21 15:00, Rasmus Villemoes wrote: >> Now what CONFIG_* knobs are responsible for putting -mabi=apcs-gnu in >> CFLAGS is left as an exercise for the reader. Regardless, it is not a >> bug in the compiler. The e

Re: [PATCH] amdgpu: fix gcc -Wrestrict warning

2021-03-23 Thread Rasmus Villemoes
On 23/03/2021 14.04, Arnd Bergmann wrote: > From: Arnd Bergmann > > gcc warns about an sprintf() that uses the same buffer as source > and destination, which is undefined behavior in C99: > > drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c: In function > 'amdgpu_securedisplay_debugfs_write':

[PATCH] printk: rename vprintk_func to vprintk

2021-03-23 Thread Rasmus Villemoes
xor%eax,%eax 332: c3 ret 333: 8d b4 26 00 00 00 00lea0x0(%esi,%eiz,1),%esi 33a: 8d b6 00 00 00 00 lea0x0(%esi),%esi Signed-off-by: Rasmus Villemoes --- kernel/printk/internal.h| 3 --- kernel/printk/printk.c | 8 +---

Re: [kbuild-all] Re: include/linux/compiler_types.h:315:38: error: call to '__compiletime_assert_536' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct can_frame, len) != offsetof(st

2021-03-23 Thread Rasmus Villemoes
On 23/03/2021 13.49, Oliver Hartkopp wrote: > > > On 23.03.21 12:36, Rasmus Villemoes wrote: >> >> and more directly from the horse's mouth: >> >> https://developer.arm.com/documentation/dui0067/d/arm-compiler-reference/c-and-c---implementation-details

Re: [PATCH] Input: analog - fix invalid snprintf() call

2021-03-23 Thread Rasmus Villemoes
On 23/03/2021 14.14, Arnd Bergmann wrote: > From: Arnd Bergmann > > overlapping input and output arguments to snprintf() are > undefined behavior in C99: > Good luck: https://lore.kernel.org/lkml/1457469654-17059-1-git-send-email-li...@rasmusvillemoes.dk/ At least 5 years ago the consensus fro

Re: [kbuild-all] Re: include/linux/compiler_types.h:315:38: error: call to '__compiletime_assert_536' declared with attribute error: BUILD_BUG_ON failed: offsetof(struct can_frame, len) != offsetof(st

2021-03-23 Thread Rasmus Villemoes
On 23/03/2021 08.45, Oliver Hartkopp wrote: > IMO we facing a compiler problem here - and we should be very happy that > the BUILD_BUG_ON() triggered an issue after years of silence. > > I do not have a good feeling about what kind of strange effects this > compiler issue might have in other code

[PATCH] USB: gadget: legacy: remove left-over __ref annotations

2021-03-23 Thread Rasmus Villemoes
;usb: gadget: remove incorrect __init/__exit annotations"). It really never makes sense for a function to be marked __ref unless it (1) has some conditional that chooses whether to call an __init function (or access __initdata) or not and (2) has a comment explaining why the __ref is there and why

[PATCH] clkdev: remove unnecessary __ref annotations

2021-03-22 Thread Rasmus Villemoes
ea17c9d868c1 (sh: Use generic clkdev.h header). Signed-off-by: Rasmus Villemoes --- drivers/clk/clkdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index 0f2e3fcf0f19..d446c2c697d5 100644 --- a/drivers/clk/clkdev.c +++ b

Re: [PATCH 06/12] tools: sync small_const_nbits() macro with the kernel

2021-03-22 Thread Rasmus Villemoes
l_const_nbits(size)) { + unsigned long val = *addr & GENMASK(size - 1, 0); blow up at run-time. Other than that (and the above commit log typo), consider the series Acked-by: Rasmus Villemoes

Re: [PATCH 2/3] static_call: Align static_call_is_init() patching condition

2021-03-19 Thread Rasmus Villemoes
On 19/03/2021 15.40, Rasmus Villemoes wrote: > On 19/03/2021 15.13, Peter Zijlstra wrote: > >>> Dunno, probably overkill, but perhaps we could have an atomic_t (or >>> refcount, whatever) init_ref inited to 1, with init_ref_get() doing an >>> inc_unless_zero, and

Re: [PATCH 2/3] static_call: Align static_call_is_init() patching condition

2021-03-19 Thread Rasmus Villemoes
On 19/03/2021 15.13, Peter Zijlstra wrote: >> Dunno, probably overkill, but perhaps we could have an atomic_t (or >> refcount, whatever) init_ref inited to 1, with init_ref_get() doing an >> inc_unless_zero, and iff you get a ref, you're free to call (/patch) >> __init functions and access __initd

Re: [PATCH 2/3] static_call: Align static_call_is_init() patching condition

2021-03-19 Thread Rasmus Villemoes
On 18/03/2021 12.31, Peter Zijlstra wrote: > The intent is to avoid writing init code after init (because the text > might have been freed). The code is needlessly different between > jump_label and static_call and not obviously correct. > > The existing code relies on the fact that the module loa

Re: [RFC PATCH] devres: better type safety with devm_*_action()

2021-03-18 Thread Rasmus Villemoes
On 10/03/2021 00.59, Rasmus Villemoes wrote: [quoting in full for context to the new CCs] > With a little MacroMagic(tm), we can allow users to pass a pointer to > a function that actually takes the type of the data argument, instead > of forcing the function to have prototype void

Re: [PATCH] ARM: decompressor: remove unused global variable output_data

2021-03-18 Thread Rasmus Villemoes
On 08/03/2021 15.29, Rasmus Villemoes wrote: > output_data seems to have been write-only since the flush_window() > callback was removed in commit e7db7b4270ed ("arm: add support for > LZO-compressed kernels"). Ping.

Re: [PATCH 1/2] devtmpfs: fix placement of complete() call

2021-03-18 Thread Rasmus Villemoes
On 12/03/2021 11.30, Rasmus Villemoes wrote: > Calling complete() from within the __init function is wrong - > theoretically, the init process could proceed all the way to freeing > the init mem before the devtmpfsd thread gets to execute the return > instruction in devtmpfs_setup().

Re: [PATCH v5] printk: Userspace format enumeration support

2021-03-18 Thread Rasmus Villemoes
On 18/03/2021 11.46, Petr Mladek wrote: > BTW: Is the trick with int (printk)(const char *s, ...) documented > somewhere? Is it portable? It is completely standard and portable C, explicitly spelled out in the C standard itself. C99: === 6.10.3 Macro replacement 10 [...] Each subsequent instanc

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

2021-03-17 Thread Rasmus Villemoes
On 17/03/2021 06.40, Yury Norov wrote: > On Tue, Mar 16, 2021 at 01:42:45PM +0200, Andy Shevchenko wrote: >>> It would also be much easier to review if you just redefined the >>> BITMAP_LAST_WORD_MASK macros etc. in terms of these new things, so you >>> wouldn't have to do a lot of mechanical chan

Re: [PATCH v2] Increase page and bit waitqueue hash size

2021-03-17 Thread Rasmus Villemoes
On 17/03/2021 08.54, Nicholas Piggin wrote: > +#if CONFIG_BASE_SMALL > +static const unsigned int page_wait_table_bits = 4; > static wait_queue_head_t page_wait_table[PAGE_WAIT_TABLE_SIZE] > __cacheline_aligned; > > + if (!CONFIG_BASE_SMALL) { > + page_wait_table = alloc_large

Re: [PATCH v5] printk: Userspace format enumeration support

2021-03-17 Thread Rasmus Villemoes
On 17/03/2021 09.40, Petr Mladek wrote: > On Tue 2021-03-16 14:28:12, Chris Down wrote: >> Rasmus Villemoes writes: >>> I think it's pointless renaming the symbol to _printk, with all the >>> churn and reduced readability that involves (especially when reading

Re: [PATCH v5] printk: Userspace format enumeration support

2021-03-16 Thread Rasmus Villemoes
On 10/03/2021 03.30, Chris Down wrote: > --- > MAINTAINERS | 5 + > arch/arm/kernel/entry-v7m.S | 2 +- > arch/arm/lib/backtrace-clang.S | 2 +- > arch/arm/lib/backtrace.S | 2 +- > arch/arm/mach-rpc/io-acorn.S | 2 +- > arch/a

Re: [PATCH 06/13] lib: extend the scope of small_const_nbits() macro

2021-03-16 Thread Rasmus Villemoes
On 16/03/2021 02.54, Yury Norov wrote: > find_bit would also benefit from small_const_nbits() optimizations. > > Signed-off-by: Yury Norov > --- > include/asm-generic/bitsperlong.h | 9 + > include/linux/bitmap.h| 3 --- > 2 files changed, 9 insertions(+), 3 deletions(-) > >

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

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

Re: [PATCH 02/13] tools: bitmap: sync function declarations with the kernel

2021-03-16 Thread Rasmus Villemoes
On 16/03/2021 02.54, Yury Norov wrote: > Some functions in tools/include/linux/bitmap.h declare nbits as int. In the > kernel nbits is declared as unsigned int. > > Signed-off-by: Yury Norov Acked-by: Rasmus Villemoes

Re: [PATCH 01/13] tools: disable -Wno-type-limits

2021-03-16 Thread Rasmus Villemoes
On 16/03/2021 02.54, Yury Norov wrote: > GENMASK(h, l) may be passed with unsigned types. In such case, type-limits > warning is generated for example in case of GENMASK(h, 0). > > Signed-off-by: Yury Norov > --- > tools/scripts/Makefile.include | 1 + > 1 file changed, 1 insertion(+) > > diff

Re: [PATCH v3 1/2] init/initramfs.c: do unpacking asynchronously

2021-03-15 Thread Rasmus Villemoes
On 15/03/2021 22.33, Andrew Morton wrote: > On Sat, 13 Mar 2021 22:25:27 +0100 Rasmus Villemoes > wrote: > >> Most of the boot process doesn't actually need anything from the >> initramfs, until of course PID1 is to be executed. So instead of doing >> the dec

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 don't

[PATCH v3 1/2] init/initramfs.c: do unpacking asynchronously

2021-03-13 Thread Rasmus Villemoes
. So there is an escape hatch in the form of an initramfs_async= command line parameter. Signed-off-by: Rasmus Villemoes --- .../admin-guide/kernel-parameters.txt | 12 ++ drivers/base/firmware_loader/main.c | 2 + include/linux/initrd.h|

[PATCH v3 2/2] modules: add CONFIG_MODPROBE_PATH

2021-03-13 Thread Rasmus Villemoes
pletely in the background while devices get probed means I get to handle the gpio watchdog in time without getting reset. [1] __request_module() already has an early -ENOENT return when modprobe_path is the empty string. Reviewed-by: Greg Kroah-Hartman Acked-by: Jessica Yu Signed-off-by: Rasmus

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

2021-03-13 Thread Rasmus Villemoes
he subsystem being used. - Add A-b, R-b to patch 2. Rasmus Villemoes (2): init/initramfs.c: do unpacking asynchronously modules: add CONFIG_MODPROBE_PATH .../admin-guide/kernel-parameters.txt | 12 ++ drivers/base/firmware_loader/main.c | 2 + include/linux/i

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

2021-03-13 Thread Rasmus Villemoes
On 11/03/2021 19.02, Linus Torvalds wrote: > On Wed, Mar 10, 2021 at 5:45 PM Rasmus Villemoes > wrote: >> >> Hm, gcc does elide the test of the return value, but jumps back to a >> place where it always loads state from its memory location and does the >> who

[PATCH 2/2] devtmpfs: actually reclaim some init memory

2021-03-12 Thread Rasmus Villemoes
on() is in an __init function. Signed-off-by: Rasmus Villemoes --- drivers/base/devtmpfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c index aedeb2dc1a18..8be352ab4ddb 100644 --- a/drivers/base/devtmpfs.c +++ b/drivers/ba

[PATCH 1/2] devtmpfs: fix placement of complete() call

2021-03-12 Thread Rasmus Villemoes
which we'll fix in a subsequent patch. Fixes: bcbacc4909f1 ("devtmpfs: refactor devtmpfsd()") Signed-off-by: Rasmus Villemoes --- drivers/base/devtmpfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.

Re: [PATCH 14/14] MAINTAINERS: Add entry for the bitmap API

2021-03-12 Thread Rasmus Villemoes
On 18/02/2021 16.34, Yury Norov wrote: > On Thu, Feb 18, 2021 at 05:28:32PM +0200, Andy Shevchenko wrote: >> On Wed, Feb 17, 2021 at 08:05:12PM -0800, Yury Norov wrote: >>> Add myself as maintainer for bitmap API. >>> >>> I'm an author of current implementation of lib/find_bit and an >>> active con

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

2021-03-12 Thread Rasmus Villemoes
On 12/03/2021 06.28, Yury Norov wrote: > On Fri, Feb 19, 2021 at 12:07:27AM +0100, Rasmus Villemoes wrote: >> 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 opera

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

2021-03-10 Thread Rasmus Villemoes
On 11/03/2021 01.17, Rasmus Villemoes wrote: > On 09/03/2021 23.16, Linus Torvalds wrote: >> On Tue, Mar 9, 2021 at 1:17 PM Rasmus Villemoes >> wrote: >>> >>> So add an initramfs_async= kernel parameter, allowing the main init >>> process to proceed to h

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

2021-03-10 Thread Rasmus Villemoes
On 09/03/2021 23.16, Linus Torvalds wrote: > On Tue, Mar 9, 2021 at 1:17 PM 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

[PATCH] scsi: bnx2i: make bnx2i_process_iscsi_error simpler and more robust

2021-03-10 Thread Rasmus Villemoes
;. Also give the message pointer a similar treatment - there's no point making temporary copies on the stack of those two strings. Signed-off-by: Rasmus Villemoes --- drivers/scsi/bnx2i/bnx2i_hwi.c | 85 -- 1 file changed, 41 insertions(+), 44 deletions(-) dif

[PATCH resend] kernel/cred.c: make init_groups static

2021-03-10 Thread Rasmus Villemoes
init_groups is declared in both cred.h and init_task.h, but it is not actually referenced anywhere outside of cred.c where it is defined. So make it static and remove the declarations. Signed-off-by: Rasmus Villemoes --- include/linux/cred.h | 1 - include/linux/init_task.h | 1 - kernel

Re: [PATCH] [RFC] arm64: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION

2021-03-10 Thread Rasmus Villemoes
On 10/03/2021 21.49, Masahiro Yamada wrote: > On Mon, Mar 1, 2021 at 10:11 AM Nicholas Piggin wrote: > > I tested LD_DEAD_CODE_DATA_ELIMINATION for the latest kernel. > > I added an unused function, this_func_is_unused(), > then built the ppc kernel with LD_DEAD_CODE_DATA_ELIMINATION. > > It r

[RFC PATCH] devres: better type safety with devm_*_action()

2021-03-09 Thread Rasmus Villemoes
for a trivial local wrapper - e.g. drivers/watchdog/cadence_wdt.c could just use clk_disable_unprepare directly and avoid defining cdns_clk_disable_unprepare. Signed-off-by: Rasmus Villemoes --- drivers/base/devres.c | 32 +++- include

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

2021-03-09 Thread Rasmus Villemoes
On 09/03/2021 23.16, Linus Torvalds wrote: > On Tue, Mar 9, 2021 at 1:17 PM 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 v2 1/2] init/initramfs.c: allow asynchronous unpacking

2021-03-09 Thread Rasmus Villemoes
On 09/03/2021 23.07, Linus Torvalds wrote: > On Tue, Mar 9, 2021 at 1:17 PM 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_rootfs

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

2021-03-09 Thread Rasmus Villemoes
;ugeth_primary_info, sizeof(*ug_info), GFP_KERNEL); > if (ug_info == NULL) > return -ENOMEM; > - memcpy(ug_info, &ugeth_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

[PATCH v2 2/2] modules: add CONFIG_MODPROBE_PATH

2021-03-09 Thread Rasmus Villemoes
g proceeds completely in the background while devices get probed means I get to handle the gpio watchdog in time without getting reset. [1] __request_module() already has an early -ENOENT return when modprobe_path is the empty string. Signed-off-by: Rasmus Villemoes --- init/Kconfig | 12 ++

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

2021-03-09 Thread Rasmus Villemoes
m wait_for_initramfs(). - Fix initialization of initramfs_async variable. Rasmus Villemoes (2): init/initramfs.c: allow asynchronous unpacking modules: add CONFIG_MODPROBE_PATH .../admin-guide/kernel-parameters.txt | 12 ++ drivers/base/firmware_loader/main.c | 2 + in

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

2021-03-09 Thread Rasmus Villemoes
es is roughly the same as above, but with 172 lines inbetween - so more than one cpu has been kept busy doing work that would otherwise only happen after the populate_rootfs() finished. Signed-off-by: Rasmus Villemoes --- .../admin-guide/kernel-parameters.txt | 12 ++ drivers

Re: [PATCH v2 3/4] kbuild: re-implement CONFIG_TRIM_UNUSED_KSYMS to make it work in one-pass

2021-03-09 Thread Rasmus Villemoes
On 09/03/2021 20.54, Nicolas Pitre wrote: > On Wed, 10 Mar 2021, Masahiro Yamada wrote: > >>> I'm not sure I do understand every detail here, especially since it is >>> so far away from the version that I originally contributed. But the >>> concept looks good. >>> >>> I still think that there is

[PATCH 2/2] kernel/async.c: remove async_unregister_domain()

2021-03-09 Thread Rasmus Villemoes
No callers in the tree. Signed-off-by: Rasmus Villemoes --- include/linux/async.h | 1 - kernel/async.c| 18 -- 2 files changed, 19 deletions(-) diff --git a/include/linux/async.h b/include/linux/async.h index 0a17cd27f348..cce4ad31e8fc 100644 --- a/include/linux

[PATCH 1/2] kernel/async.c: stop guarding pr_debug() statements

2021-03-09 Thread Rasmus Villemoes
ktime_get() for the starttime value, but the corresponding ktime_get for the end time can be elided by factoring it into a function which only gets called if the printk() arguments end up being evaluated. Signed-off-by: Rasmus Villemoes --- Andrew, this one is of course on top of https://lore.kerne

Re: [PATCH RESEND 0/2] Common protected-clocks implementation

2021-03-09 Thread Rasmus Villemoes
On 03/09/2020 06.00, Samuel Holland wrote: > Stephen, Maxime, > > You previously asked me to implement the protected-clocks property in a > driver-independent way: > > https://www.spinics.net/lists/arm-kernel/msg753832.html > > I provided an implementation 6 months ago, which I am resending now:

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

2021-03-08 Thread Rasmus Villemoes
On 08/03/2021 22.38, Rob Herring wrote: > On Mon, Mar 08, 2021 at 09:02:29PM +0100, Rasmus Villemoes wrote: >> On 08/03/2021 18.21, Rob Herring wrote: >>> On Fri, Feb 26, 2021 at 03:14:10PM +0100, Rasmus Villemoes wrote: >>>> While a ripple counter can not usuall

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

2021-03-08 Thread Rasmus Villemoes
On 08/03/2021 18.21, Rob Herring wrote: > On Fri, Feb 26, 2021 at 03:14:10PM +0100, Rasmus Villemoes wrote: >> While a ripple counter can not usually be interfaced with (directly) >> from software, it may still be a crucial component in a board >> layout. To prevent its i

[PATCH] ARM: decompressor: remove unused global variable output_data

2021-03-08 Thread Rasmus Villemoes
output_data seems to have been write-only since the flush_window() callback was removed in commit e7db7b4270ed ("arm: add support for LZO-compressed kernels"). Signed-off-by: Rasmus Villemoes --- arch/arm/boot/compressed/misc.c | 5 + 1 file changed, 1 insertion(+), 4 deletion

[PATCH] kbuild: apply fixdep logic to link-vmlinux.sh

2021-03-05 Thread Rasmus Villemoes
dependency. To fix this, make link-vmlinux.sh emit a .vmlinux.d file in the same format as the dependency files generated by gcc, and apply the fixdep logic to that. I've tested that this correctly works with both in-tree and out-of-tree builds. Signed-off-by: Rasmus Villemoes --- Mak

[PATCH v2] kbuild: add CONFIG_VMLINUX_MAP expert option

2021-03-05 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 make it depend on CONFIG_EXPERT. Signed-off-by: Rasmus Villemoes --- .gitignore | 1 + Documentation/dontdiff | 1 + lib/Kconfig.debug | 10 +

[PATCH] clk: use clk_core_enable_lock() a bit more

2021-03-04 Thread Rasmus Villemoes
Use clk_core_enable_lock() and clk_core_disable_lock() in a few places rather than open-coding them. Signed-off-by: Rasmus Villemoes --- drivers/clk/clk.c | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index

Re: [PATCH 5/7] printk: Make %pS and friends print module build ID

2021-03-04 Thread Rasmus Villemoes
On 04/03/2021 20.15, Stephen Boyd wrote: > Quoting Matthew Wilcox (2021-03-04 09:00:52) >> On Mon, Mar 01, 2021 at 09:47:47AM -0800, Stephen Boyd wrote: >>> Example: >>> >>> WARNING: CPU: 4 PID: 3255 at drivers/misc/lkdtm/bugs.c:83 >>> lkdtm_WARNING+0x28/0x30 [lkdtm] (ed5019fdf5e53be37cb1ba789929

Re: [PATCH] kbuild: add CONFIG_VMLINUX_MAP expert option

2021-03-04 Thread Rasmus Villemoes
On 24/02/2021 11.52, Rasmus Villemoes wrote: > It can be quite useful to have ld emit a link map file, in order to > debug or verify that special sections end up where they are supposed > to, and to see what LD_DEAD_CODE_DATA_ELIMINATION manages to get rid > of. > > The only r

[PATCH v2 0/3] add "delay" clock support to gpio_wdt

2021-03-04 Thread Rasmus Villemoes
;s already above what the spec says, and other random changes in the future might make the gap even wider. So I don't know. The hardware is obviously misdesigned, and I don't know how far the mainline kernel should stretch to support this; OTOH the kernel does contain lots of workarounds for

[PATCH v2 2/3] dt-bindings: watchdog: add optional "delay" clock to gpio-wdt binding

2021-03-04 Thread Rasmus Villemoes
is enabled, and since linux by default disables unused clocks, that effectively renders the watchdog useless. So add an optional "delay" clock binding. Suggested-by: Arnd Bergmann Signed-off-by: Rasmus Villemoes --- Documentation/devicetree/bindings/watchdog/gpio-wdt.txt | 6 +

[PATCH v2 3/3] watchdog: gpio_wdt: implement support for optional "delay" clock

2021-03-04 Thread Rasmus Villemoes
is enabled, and since linux by default disables unused clocks, that effectively renders the watchdog useless. Add driver support for an optional "delay" clock, as documented in the preceding patch. Signed-off-by: Rasmus Villemoes --- drivers/watchdog/gpio_wdt.c | 9 + 1 file c

[PATCH v2 1/3] clk: add devm_clk_prepare_enable() helper

2021-03-04 Thread Rasmus Villemoes
Add a managed wrapper for clk_prepare_enable(). Signed-off-by: Rasmus Villemoes --- .../driver-api/driver-model/devres.rst| 1 + drivers/clk/clk-devres.c | 29 +++ include/linux/clk.h | 13 + 3 files changed, 43

Re: linux-kernel janitorial RFP: Mark static arrays as const

2021-03-03 Thread Rasmus Villemoes
On 02/03/2021 18.42, Joe Perches wrote: > Here is a possible opportunity to reduce data usage in the kernel. > > $ git grep -P -n '^static\s+(?!const|struct)(?:\w+\s+){1,3}\w+\s*\[\s*\]' > drivers/ | \ > grep -v __initdata | \ > wc -l > 3250 > > Meaning there are ~3000 declarations of arrays

Re: [PATCH 3/3] [v4] lib/vsprintf: no_hash_pointers prints all addresses as unhashed

2021-03-02 Thread Rasmus Villemoes
On 02/03/2021 15.28, Geert Uytterhoeven wrote: > Fortunately gcc is already smart enough to deduplicate identical strings, > but only in the same source file. Yeah, gcc can't do much more since it only handles one source file at a time. However, the linker certainly deduplicates strings across tr

  1   2   3   4   5   6   7   8   9   10   >