Re: [PATCH] staging: lustre: Remove VLA usage

2018-03-07 Thread Rasmus Villemoes
On Wed, Mar 07 2018, Kees Cook wrote: > On Wed, Mar 7, 2018 at 5:10 AM, Rasmus Villemoes > wrote: >> On 2018-03-07 06:46, Kees Cook wrote: >>> The kernel would like to remove all VLA usage. This switches to a >>> simple kasprintf() instead. >>>

Re: [PATCH] staging: lustre: Remove VLA usage

2018-03-07 Thread Rasmus Villemoes
On 2018-03-07 06:46, Kees Cook wrote: > The kernel would like to remove all VLA usage. This switches to a > simple kasprintf() instead. > > Signed-off-by: Kees Cook > --- > drivers/staging/lustre/lustre/llite/xattr.c | 19 +-- > 1 file changed, 13

Re: [PATCH] staging: lustre: Remove VLA usage

2018-03-07 Thread Rasmus Villemoes
On 2018-03-07 06:46, Kees Cook wrote: > The kernel would like to remove all VLA usage. This switches to a > simple kasprintf() instead. > > Signed-off-by: Kees Cook > --- > drivers/staging/lustre/lustre/llite/xattr.c | 19 +-- > 1 file changed, 13 insertions(+), 6 deletions(-) >

Re: [PATCH] vsprintf: Make "null" pointer dereference more robust

2018-03-05 Thread Rasmus Villemoes
On 2 March 2018 at 13:53, Petr Mladek wrote: > %p has many modifiers where the pointer is dereferenced. An invalid > pointer might cause kernel to crash silently. > > Note that printk() formats the string under logbuf_lock. Any recursive > printks are redirected to the

Re: [PATCH] vsprintf: Make "null" pointer dereference more robust

2018-03-05 Thread Rasmus Villemoes
On 2 March 2018 at 13:53, Petr Mladek wrote: > %p has many modifiers where the pointer is dereferenced. An invalid > pointer might cause kernel to crash silently. > > Note that printk() formats the string under logbuf_lock. Any recursive > printks are redirected to the printk_safe implementation

Re: [PATCH 3/3] fixdep: do not ignore kconfig.h

2018-03-05 Thread Rasmus Villemoes
On 5 March 2018 at 05:52, Masahiro Yamada <yamada.masah...@socionext.com> wrote: > 2018-03-01 4:17 GMT+09:00 Rasmus Villemoes <li...@rasmusvillemoes.dk>: >> kconfig.h was excluded from consideration by fixdep by >> 6a5be57f0f00 (fixdep: fix extraneous dependencies) to a

Re: [PATCH 3/3] fixdep: do not ignore kconfig.h

2018-03-05 Thread Rasmus Villemoes
On 5 March 2018 at 05:52, Masahiro Yamada wrote: > 2018-03-01 4:17 GMT+09:00 Rasmus Villemoes : >> kconfig.h was excluded from consideration by fixdep by >> 6a5be57f0f00 (fixdep: fix extraneous dependencies) to avoid some false >> positive hits [...] >> We've alr

Re: [RFC 2/5] ia64/sn/hwperf: use seq_open_data

2018-03-02 Thread Rasmus Villemoes
On 2 March 2018 at 00:37, Rasmus Villemoes <li...@rasmusvillemoes.dk> wrote: > This code should check the return value of seq_open(); if it failed, > file->private_data is NULL. But we can avoid the issue entirely and > simplify the code by letting seq_open_data() set th

Re: [RFC 2/5] ia64/sn/hwperf: use seq_open_data

2018-03-02 Thread Rasmus Villemoes
On 2 March 2018 at 00:37, Rasmus Villemoes wrote: > This code should check the return value of seq_open(); if it failed, > file->private_data is NULL. But we can avoid the issue entirely and > simplify the code by letting seq_open_data() set the ->private member > to objbuf.

[RFC 3/5] powerpc/pseries: use seq_open_data in hcall_inst_seq_open

2018-03-01 Thread Rasmus Villemoes
This code should check the return value of seq_open(); if it failed, file->private_data is NULL. But we can avoid the issue entirely and simplify the code by letting seq_open_data() set the ->private member. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> --- arch/power

[RFC 3/5] powerpc/pseries: use seq_open_data in hcall_inst_seq_open

2018-03-01 Thread Rasmus Villemoes
This code should check the return value of seq_open(); if it failed, file->private_data is NULL. But we can avoid the issue entirely and simplify the code by letting seq_open_data() set the ->private member. Signed-off-by: Rasmus Villemoes --- arch/powerpc/platforms/pseries/hvCall_inst

[RFC 4/5] fm10k: use seq_open_data()

2018-03-01 Thread Rasmus Villemoes
Simplify the code slightly by having seq_open_data do the ->private assignment. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> --- drivers/net/ethernet/intel/fm10k/fm10k_debugfs.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/net/ether

[RFC 4/5] fm10k: use seq_open_data()

2018-03-01 Thread Rasmus Villemoes
Simplify the code slightly by having seq_open_data do the ->private assignment. Signed-off-by: Rasmus Villemoes --- drivers/net/ethernet/intel/fm10k/fm10k_debugfs.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_debugfs.c

[RFC 1/5] seq_file: introduce seq_open_data helper

2018-03-01 Thread Rasmus Villemoes
There are quite a few callers of seq_open that could be simplified by setting the ->private member via the seq_open call instead of fetching file->private_data afterwards. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> --- I've just included a few examples of po

[RFC 2/5] ia64/sn/hwperf: use seq_open_data

2018-03-01 Thread Rasmus Villemoes
This code should check the return value of seq_open(); if it failed, file->private_data is NULL. But we can avoid the issue entirely and simplify the code by letting seq_open_data() set the ->private member to objbuf. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> ---

[RFC 1/5] seq_file: introduce seq_open_data helper

2018-03-01 Thread Rasmus Villemoes
There are quite a few callers of seq_open that could be simplified by setting the ->private member via the seq_open call instead of fetching file->private_data afterwards. Signed-off-by: Rasmus Villemoes --- I've just included a few examples of possible users of this helper, there are man

[RFC 2/5] ia64/sn/hwperf: use seq_open_data

2018-03-01 Thread Rasmus Villemoes
This code should check the return value of seq_open(); if it failed, file->private_data is NULL. But we can avoid the issue entirely and simplify the code by letting seq_open_data() set the ->private member to objbuf. Signed-off-by: Rasmus Villemoes --- arch/ia64/sn/kernel/sn2/sn_hwperf

[RFC 5/5] PCI: tegra: use seq_open_data

2018-03-01 Thread Rasmus Villemoes
Simplify the code slightly by having seq_open_data do the ->private assignment. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> --- drivers/pci/host/pci-tegra.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/pci/host/pci-tegra.c b/dr

[RFC 5/5] PCI: tegra: use seq_open_data

2018-03-01 Thread Rasmus Villemoes
Simplify the code slightly by having seq_open_data do the ->private assignment. Signed-off-by: Rasmus Villemoes --- drivers/pci/host/pci-tegra.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c in

[PATCH resend] drivers/char/random.c: remove unused dont_count_entropy

2018-02-28 Thread Rasmus Villemoes
l/git/tglx/history.git/commit/?id=c1c48e61c251f57e7a3f1bf11b3c462b2de9dcb5 Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> --- drivers/char/random.c | 53 --- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/drivers

[PATCH resend] drivers/char/random.c: remove unused dont_count_entropy

2018-02-28 Thread Rasmus Villemoes
l/git/tglx/history.git/commit/?id=c1c48e61c251f57e7a3f1bf11b3c462b2de9dcb5 Signed-off-by: Rasmus Villemoes --- drivers/char/random.c | 53 --- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/drivers/char/random.c b/drivers/char/rand

[PATCH] vfs: make sure struct filename->iname is word-aligned

2018-02-28 Thread Rasmus Villemoes
_from_user. Instead of explicit padding, simply swap the refcnt and aname members, as suggested by Al Viro. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> --- fs/namei.c | 2 ++ include/linux/fs.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/name

[PATCH] vfs: make sure struct filename->iname is word-aligned

2018-02-28 Thread Rasmus Villemoes
_from_user. Instead of explicit padding, simply swap the refcnt and aname members, as suggested by Al Viro. Signed-off-by: Rasmus Villemoes --- fs/namei.c | 2 ++ include/linux/fs.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/namei.c b/fs/namei.c index 92

[PATCH 3/3] fixdep: do not ignore kconfig.h

2018-02-28 Thread Rasmus Villemoes
change that to FOO if we care [2] https://lkml.org/lkml/2018/2/22/838 Cc: Linus Torvalds <torva...@linux-foundation.org> Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> --- scripts/basic/fixdep.c | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/basic/fixdep.c b/s

[PATCH 3/3] fixdep: do not ignore kconfig.h

2018-02-28 Thread Rasmus Villemoes
change that to FOO if we care [2] https://lkml.org/lkml/2018/2/22/838 Cc: Linus Torvalds Signed-off-by: Rasmus Villemoes --- scripts/basic/fixdep.c | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 1b21870d6e7f..449b68c4c90c 100644 --- a/scripts

[PATCH 1/3] fixdep: remove stale references to uml-config.h

2018-02-28 Thread Rasmus Villemoes
gt; Cc: Richard Weinberger <rich...@nod.at> Cc: user-mode-linux-de...@lists.sourceforge.net Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> --- scripts/basic/fixdep.c | 9 - 1 file changed, 9 deletions(-) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c

[PATCH 2/3] fixdep: remove some false CONFIG_ matches

2018-02-28 Thread Rasmus Villemoes
...) lines from the .o.cmd files. Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> --- scripts/basic/fixdep.c | 5 + 1 file changed, 5 insertions(+) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index d7fbe545dd5d..1b21870d6e7f 100644 --- a/scripts/basic/fixdep.c

[PATCH 1/3] fixdep: remove stale references to uml-config.h

2018-02-28 Thread Rasmus Villemoes
-mode-linux-de...@lists.sourceforge.net Signed-off-by: Rasmus Villemoes --- scripts/basic/fixdep.c | 9 - 1 file changed, 9 deletions(-) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index fa3d39b6f23b..d7fbe545dd5d 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic

[PATCH 2/3] fixdep: remove some false CONFIG_ matches

2018-02-28 Thread Rasmus Villemoes
...) lines from the .o.cmd files. Signed-off-by: Rasmus Villemoes --- scripts/basic/fixdep.c | 5 + 1 file changed, 5 insertions(+) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index d7fbe545dd5d..1b21870d6e7f 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c

Re: [PATCH] EDAC, layerscape: allow building for LS1021A

2018-02-27 Thread Rasmus Villemoes
On 2018-02-22 22:22, York Sun wrote: > Then you are good to go. Great. Borislav, will you pick this up? Rasmus

Re: [PATCH] EDAC, layerscape: allow building for LS1021A

2018-02-27 Thread Rasmus Villemoes
On 2018-02-22 22:22, York Sun wrote: > Then you are good to go. Great. Borislav, will you pick this up? Rasmus

Re: [PATCH/RFC] headers: drop 2 #included headers from

2018-02-25 Thread Rasmus Villemoes
On Fri, Feb 16 2018, Ingo Molnar wrote: > * Randy Dunlap wrote: > >> Does anyone know or see why needs or >> ? There are no direct uses in AFAICT. > > These are likely historical, plus it's a classic 'tragedy of the commons' > scenario: it's easy to

Re: [PATCH/RFC] headers: drop 2 #included headers from

2018-02-25 Thread Rasmus Villemoes
On Fri, Feb 16 2018, Ingo Molnar wrote: > * Randy Dunlap wrote: > >> Does anyone know or see why needs or >> ? There are no direct uses in AFAICT. > > These are likely historical, plus it's a classic 'tragedy of the commons' > scenario: it's easy to take away from the "public good" of

[PATCH v5 2/2] dt/bindings: Add bindings for Layerscape external irqs

2018-02-23 Thread Rasmus Villemoes
This adds Device Tree binding documentation for the external interrupt lines with configurable polarity present on some Layerscape SOCs. Signed-off-by: Rasmus Villemoes <rasmus.villem...@prevas.dk> --- .../interrupt-controller/fsl,ls-extirq.txt | 44 ++ 1 file c

[PATCH v5 0/2] irqchip: add support for Layerscape external interrupt lines

2018-02-23 Thread Rasmus Villemoes
v3: - Add non-empty commit log to 2/2 Changes since v2: - use fsl,bit-reverse rather than bit-reverse - make the dts node a child of the scfg node - make the node name "interrupt-controller" Rasmus Villemoes (2): irqchip: add support for Layerscape external interrupt lines dt/bin

[PATCH v5 2/2] dt/bindings: Add bindings for Layerscape external irqs

2018-02-23 Thread Rasmus Villemoes
This adds Device Tree binding documentation for the external interrupt lines with configurable polarity present on some Layerscape SOCs. Signed-off-by: Rasmus Villemoes --- .../interrupt-controller/fsl,ls-extirq.txt | 44 ++ 1 file changed, 44 insertions(+) create

[PATCH v5 0/2] irqchip: add support for Layerscape external interrupt lines

2018-02-23 Thread Rasmus Villemoes
v3: - Add non-empty commit log to 2/2 Changes since v2: - use fsl,bit-reverse rather than bit-reverse - make the dts node a child of the scfg node - make the node name "interrupt-controller" Rasmus Villemoes (2): irqchip: add support for Layerscape external interrupt lines dt/bin

[PATCH v5 1/2] irqchip: add support for Layerscape external interrupt lines

2018-02-23 Thread Rasmus Villemoes
The LS1021A allows inverting the polarity of six interrupt lines IRQ[0:5] via the scfg_intpcr register, effectively allowing IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_EDGE_FALLING for those. We just need to check the type, set the relevant bit in INTPCR accordingly, and fixup the type argument before

[PATCH v5 1/2] irqchip: add support for Layerscape external interrupt lines

2018-02-23 Thread Rasmus Villemoes
The LS1021A allows inverting the polarity of six interrupt lines IRQ[0:5] via the scfg_intpcr register, effectively allowing IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_EDGE_FALLING for those. We just need to check the type, set the relevant bit in INTPCR accordingly, and fixup the type argument before

Re: [RFC PATCH] ARM: dts: ls1021a: add size-cells and address-cells to scfg and dcfg nodes

2018-02-23 Thread Rasmus Villemoes
On 2018-02-23 14:31, Rasmus Villemoes wrote: > A single u32 is sufficient to specify a register in the Device > Configuration Unit/Supplemental Configuration Unit. Moreover, they only > consist of 32 bit registers (for the DCFG we even have "These registers > only suppor

Re: [RFC PATCH] ARM: dts: ls1021a: add size-cells and address-cells to scfg and dcfg nodes

2018-02-23 Thread Rasmus Villemoes
On 2018-02-23 14:31, Rasmus Villemoes wrote: > A single u32 is sufficient to specify a register in the Device > Configuration Unit/Supplemental Configuration Unit. Moreover, they only > consist of 32 bit registers (for the DCFG we even have "These registers > only suppor

Re: [PATCH RFC v2 1/3] drivers: irqchip: pdc: Add PDC interrupt controller for QCOM SoCs

2018-02-23 Thread Rasmus Villemoes
On 2018-02-23 14:37, Marc Zyngier wrote: > Hi Rasmus, > > On 23/02/18 12:16, Rasmus Villemoes wrote: >> On 2018-02-02 15:58, Marc Zyngier wrote: >>> Why 3? Reading the DT binding, this is indeed set to 3 without any >>> reason. I'd suggest this b

Re: [PATCH RFC v2 1/3] drivers: irqchip: pdc: Add PDC interrupt controller for QCOM SoCs

2018-02-23 Thread Rasmus Villemoes
On 2018-02-23 14:37, Marc Zyngier wrote: > Hi Rasmus, > > On 23/02/18 12:16, Rasmus Villemoes wrote: >> On 2018-02-02 15:58, Marc Zyngier wrote: >>> Why 3? Reading the DT binding, this is indeed set to 3 without any >>> reason. I'd suggest this b

[RFC PATCH] ARM: dts: ls1021a: add size-cells and address-cells to scfg and dcfg nodes

2018-02-23 Thread Rasmus Villemoes
cification is needed. Signed-off-by: Rasmus Villemoes <rasmus.villem...@prevas.dk> --- None of the in-tree .dts files using ls1021a.dtsi currently define a subnode of either node. It is possible, though somewhat unlikely, that some out-of-tree .dts file is built against the in-tree ls1021a.d

[RFC PATCH] ARM: dts: ls1021a: add size-cells and address-cells to scfg and dcfg nodes

2018-02-23 Thread Rasmus Villemoes
cification is needed. Signed-off-by: Rasmus Villemoes --- None of the in-tree .dts files using ls1021a.dtsi currently define a subnode of either node. It is possible, though somewhat unlikely, that some out-of-tree .dts file is built against the in-tree ls1021a.dtsi, and I don't know if

Re: [PATCH RFC v2 1/3] drivers: irqchip: pdc: Add PDC interrupt controller for QCOM SoCs

2018-02-23 Thread Rasmus Villemoes
On 2018-02-02 15:58, Marc Zyngier wrote: > Hi Lina, > > On 02/02/18 14:21, Lina Iyer wrote: >> From : Archana Sathyakumar >> >> + >> +static int qcom_pdc_translate(struct irq_domain *d, >> +struct irq_fwspec *fwspec, unsigned long *hwirq, unsigned int *type) >> +{ >>

Re: [PATCH RFC v2 1/3] drivers: irqchip: pdc: Add PDC interrupt controller for QCOM SoCs

2018-02-23 Thread Rasmus Villemoes
On 2018-02-02 15:58, Marc Zyngier wrote: > Hi Lina, > > On 02/02/18 14:21, Lina Iyer wrote: >> From : Archana Sathyakumar >> >> + >> +static int qcom_pdc_translate(struct irq_domain *d, >> +struct irq_fwspec *fwspec, unsigned long *hwirq, unsigned int *type) >> +{ >> +if

Re: [PATCH v3] kconfig.h: Include compiler types to avoid missed struct attributes

2018-02-22 Thread Rasmus Villemoes
On 2018-02-22 22:07, Rasmus Villemoes wrote: > > The whole point of fixdep and the include/config hierarchy is to be able > to remove the dependency on autoconf.h, but I'm not sure I understand > why kconfig.h itself is also forcibly removed. Ah, 6a5be57f "fixdep: fix extran

Re: [PATCH v3] kconfig.h: Include compiler types to avoid missed struct attributes

2018-02-22 Thread Rasmus Villemoes
On 2018-02-22 22:07, Rasmus Villemoes wrote: > > The whole point of fixdep and the include/config hierarchy is to be able > to remove the dependency on autoconf.h, but I'm not sure I understand > why kconfig.h itself is also forcibly removed. Ah, 6a5be57f "fixdep: fix extran

Re: [PATCH v3] kconfig.h: Include compiler types to avoid missed struct attributes

2018-02-22 Thread Rasmus Villemoes
On 2018-02-22 19:04, Linus Torvalds wrote: > > Lookie here (in a fully built tree): > > find . -name '*.o.cmd' | > xargs grep -L linux/compiler_types.h | > xargs grep -l linux/kconfig.h | > while read i; do > j=$(echo $i | sed 's/\.o.cmd$/\.c/' | sed

Re: [PATCH v3] kconfig.h: Include compiler types to avoid missed struct attributes

2018-02-22 Thread Rasmus Villemoes
On 2018-02-22 19:04, Linus Torvalds wrote: > > Lookie here (in a fully built tree): > > find . -name '*.o.cmd' | > xargs grep -L linux/compiler_types.h | > xargs grep -l linux/kconfig.h | > while read i; do > j=$(echo $i | sed 's/\.o.cmd$/\.c/' | sed

Re: [PATCH] EDAC, layerscape: allow building for LS1021A

2018-02-22 Thread Rasmus Villemoes
On 2018-02-20 22:01, York Sun wrote: > Sorry for top posting. I am on vacation and replying from my phone. > > The controller is compatible and the driver should work. Please double check > to make sure you can inject errors and receive interrupt. After that you are > good to go. I can indeed

Re: [PATCH] EDAC, layerscape: allow building for LS1021A

2018-02-22 Thread Rasmus Villemoes
On 2018-02-20 22:01, York Sun wrote: > Sorry for top posting. I am on vacation and replying from my phone. > > The controller is compatible and the driver should work. Please double check > to make sure you can inject errors and receive interrupt. After that you are > good to go. I can indeed

Re: [PATCH 2/2] proc: use set_puts() at /proc/*/wchan

2018-02-21 Thread Rasmus Villemoes
On 2018-02-21 01:02, Andrew Morton wrote: > On Sat, 17 Feb 2018 16:06:42 +0200 Andy Shevchenko > wrote: > >> On Sat, Feb 17, 2018 at 9:20 AM, Alexey Dobriyan wrote: >>> Signed-off-by: Alexey Dobriyan >> >> >>> -

Re: [PATCH 2/2] proc: use set_puts() at /proc/*/wchan

2018-02-21 Thread Rasmus Villemoes
On 2018-02-21 01:02, Andrew Morton wrote: > On Sat, 17 Feb 2018 16:06:42 +0200 Andy Shevchenko > wrote: > >> On Sat, Feb 17, 2018 at 9:20 AM, Alexey Dobriyan wrote: >>> Signed-off-by: Alexey Dobriyan >> >> >>> - seq_printf(m, "%s", symname); >>> + seq_puts(m,

Re: [PATCH v2 01/21] lib/vsprintf: Print time and date in human readable format via %pt

2018-02-20 Thread Rasmus Villemoes
On 2018-02-21 00:55, Joe Perches wrote: > On Tue, 2018-02-20 at 23:43 +0200, Andy Shevchenko wrote: >> There are users which print time and date represented by content of >> struct rtc_time in human readable format. >> >> Instead of open coding that each time introduce %ptR[dt][rv] specifier. >>

Re: [PATCH v2 01/21] lib/vsprintf: Print time and date in human readable format via %pt

2018-02-20 Thread Rasmus Villemoes
On 2018-02-21 00:55, Joe Perches wrote: > On Tue, 2018-02-20 at 23:43 +0200, Andy Shevchenko wrote: >> There are users which print time and date represented by content of >> struct rtc_time in human readable format. >> >> Instead of open coding that each time introduce %ptR[dt][rv] specifier. >>

[PATCH] EDAC, layerscape: allow building for LS1021A

2018-02-20 Thread Rasmus Villemoes
The LS1021A has a memory controller supported by this driver. It builds just fine, and I've done some rudimentary testing using the error injection facility, which suggests that it is indeed working. Signed-off-by: Rasmus Villemoes <rasmus.villem...@prevas.dk> --- Hi York In

[PATCH] EDAC, layerscape: allow building for LS1021A

2018-02-20 Thread Rasmus Villemoes
The LS1021A has a memory controller supported by this driver. It builds just fine, and I've done some rudimentary testing using the error injection facility, which suggests that it is indeed working. Signed-off-by: Rasmus Villemoes --- Hi York In https://patchwork.kernel.org/patch/9264623/, you

Re: 500 ms delay in time saved into RTC

2018-02-19 Thread Rasmus Villemoes
On 2018-02-19 11:07, Alexandre Belloni wrote: > On 19/02/2018 at 12:16:04 +0300, Igor Plyatov wrote: >> Dear Rasmus, >> >> thank you very much for explanation! >> >> I have set "RTC_SET_DELAY_SECS = 0.0" in hwclock.c and got acceptable >> result. >> >> It wonder why such critical function does not

Re: 500 ms delay in time saved into RTC

2018-02-19 Thread Rasmus Villemoes
On 2018-02-19 11:07, Alexandre Belloni wrote: > On 19/02/2018 at 12:16:04 +0300, Igor Plyatov wrote: >> Dear Rasmus, >> >> thank you very much for explanation! >> >> I have set "RTC_SET_DELAY_SECS = 0.0" in hwclock.c and got acceptable >> result. >> >> It wonder why such critical function does not

Re: 500 ms delay in time saved into RTC

2018-02-18 Thread Rasmus Villemoes
On 2018-02-19 07:40, Igor Plyatov wrote: > Hi! > > I have board based on AT91SAM9G20 (ARM926EJ-S CPU), Linux-4.9.36 kernel > and RTC chip DS1340 (rtc-ds1307.c driver). > > RTC chip connected by means of I2C-bus, without HW IRQ line connected. > > Kernel configured to not use embedded functions

Re: 500 ms delay in time saved into RTC

2018-02-18 Thread Rasmus Villemoes
On 2018-02-19 07:40, Igor Plyatov wrote: > Hi! > > I have board based on AT91SAM9G20 (ARM926EJ-S CPU), Linux-4.9.36 kernel > and RTC chip DS1340 (rtc-ds1307.c driver). > > RTC chip connected by means of I2C-bus, without HW IRQ line connected. > > Kernel configured to not use embedded functions

[tip:x86/pti] nospec: Allow index argument to have const-qualified type

2018-02-17 Thread tip-bot for Rasmus Villemoes
Commit-ID: b98c6a160a057d5686a8c54c79cc6c8c94a7d0c8 Gitweb: https://git.kernel.org/tip/b98c6a160a057d5686a8c54c79cc6c8c94a7d0c8 Author: Rasmus Villemoes <li...@rasmusvillemoes.dk> AuthorDate: Fri, 16 Feb 2018 13:20:48 -0800 Committer: Ingo Molnar <mi...@kernel.org> CommitD

[tip:x86/pti] nospec: Allow index argument to have const-qualified type

2018-02-17 Thread tip-bot for Rasmus Villemoes
Commit-ID: b98c6a160a057d5686a8c54c79cc6c8c94a7d0c8 Gitweb: https://git.kernel.org/tip/b98c6a160a057d5686a8c54c79cc6c8c94a7d0c8 Author: Rasmus Villemoes AuthorDate: Fri, 16 Feb 2018 13:20:48 -0800 Committer: Ingo Molnar CommitDate: Sat, 17 Feb 2018 08:40:59 +0100 nospec: Allow index

[PATCH] linux/nospec.h: allow index argument to have const-qualified type

2018-02-15 Thread Rasmus Villemoes
oted to that), so in order not to change the type of the whole expression, add a cast back to typeof(_i). Cc: sta...@vger.kernel.org Signed-off-by: Rasmus Villemoes <li...@rasmusvillemoes.dk> --- cc stable because if this is ok, there will probably be future users relying on this which also

[PATCH] linux/nospec.h: allow index argument to have const-qualified type

2018-02-15 Thread Rasmus Villemoes
oted to that), so in order not to change the type of the whole expression, add a cast back to typeof(_i). Cc: sta...@vger.kernel.org Signed-off-by: Rasmus Villemoes --- cc stable because if this is ok, there will probably be future users relying on this which also get cc'ed to -stable. include/l

Re: [PATCH] posix-timers: Protect posix clock array access against speculation

2018-02-15 Thread Rasmus Villemoes
On 2018-02-15 14:27, Thomas Gleixner wrote: > The (clock) id argument of clockid_to_kclock() comes straight from user > space via various syscalls and is used as index into the posix_clocks > array. > > Protect it against spectre v1 array out of bounds speculation. > > Signed-off-by: Thomas

Re: [PATCH] posix-timers: Protect posix clock array access against speculation

2018-02-15 Thread Rasmus Villemoes
On 2018-02-15 14:27, Thomas Gleixner wrote: > The (clock) id argument of clockid_to_kclock() comes straight from user > space via various syscalls and is used as index into the posix_clocks > array. > > Protect it against spectre v1 array out of bounds speculation. > > Signed-off-by: Thomas

Re: [PATCH] vsprintf: replace space with readable '=' before crng is ready

2018-02-12 Thread Rasmus Villemoes
On 13 February 2018 at 07:20, Shunyong Yang <shunyong.y...@hxt-semitech.com> wrote: > > This patch replaces space with readable "=" when output needs padding. > Following is the output after applying the patch, > Suggested-by: Rasmus Villemoes <li...@rasmusvillemo

Re: [PATCH] vsprintf: replace space with readable '=' before crng is ready

2018-02-12 Thread Rasmus Villemoes
On 13 February 2018 at 07:20, Shunyong Yang wrote: > > This patch replaces space with readable "=" when output needs padding. > Following is the output after applying the patch, > Suggested-by: Rasmus Villemoes > > if (unlikely(!have_filled_random_ptr_ke

Re: [PATCH v2] of: cache phandle nodes to reduce cost of of_find_node_by_phandle()

2018-02-12 Thread Rasmus Villemoes
On 2018-02-12 07:27, frowand.l...@gmail.com wrote: > From: Frank Rowand > > Create a cache of the nodes that contain a phandle property. Use this > cache to find the node for a given phandle value instead of scanning > the devicetree to find the node. If the phandle

Re: [PATCH v2] of: cache phandle nodes to reduce cost of of_find_node_by_phandle()

2018-02-12 Thread Rasmus Villemoes
On 2018-02-12 07:27, frowand.l...@gmail.com wrote: > From: Frank Rowand > > Create a cache of the nodes that contain a phandle property. Use this > cache to find the node for a given phandle value instead of scanning > the devicetree to find the node. If the phandle value is not found > in the

Re: [PATCH v4 2/2] dt/bindings: Add bindings for Layerscape external irqs

2018-02-08 Thread Rasmus Villemoes
On 2018-02-05 07:07, Rob Herring wrote: >> +Example: >> +scfg: scfg@157 { >> +compatible = "fsl,ls1021a-scfg", "syscon"; >> +... >> +extirq: interrupt-controller { >> +compatible = "fsl,ls1021a-extirq"; >> +

Re: [PATCH v4 2/2] dt/bindings: Add bindings for Layerscape external irqs

2018-02-08 Thread Rasmus Villemoes
On 2018-02-05 07:07, Rob Herring wrote: >> +Example: >> +scfg: scfg@157 { >> +compatible = "fsl,ls1021a-scfg", "syscon"; >> +... >> +extirq: interrupt-controller { >> +compatible = "fsl,ls1021a-extirq"; >> +

Re: [PATCH] ARM: dts: ls1021a: add quadspi node

2018-02-08 Thread Rasmus Villemoes
On 2018-02-05 09:03, Shawn Guo wrote: > On Fri, Jan 26, 2018 at 03:20:14PM +0100, Rasmus Villemoes wrote: >> Add a node to device tree repesenting the QuadSPI controller present on >> LS1021a. Driver support has been present since e8c034b2fbe5 (mtd: >> spi-nor: fsl-quadspi: ad

Re: [PATCH] ARM: dts: ls1021a: add quadspi node

2018-02-08 Thread Rasmus Villemoes
On 2018-02-05 09:03, Shawn Guo wrote: > On Fri, Jan 26, 2018 at 03:20:14PM +0100, Rasmus Villemoes wrote: >> Add a node to device tree repesenting the QuadSPI controller present on >> LS1021a. Driver support has been present since e8c034b2fbe5 (mtd: >> spi-nor: fsl-quadspi: ad

[PATCH] ARM: dts: ls1021a: add quadspi node

2018-01-26 Thread Rasmus Villemoes
Add a node to device tree repesenting the QuadSPI controller present on LS1021a. Driver support has been present since e8c034b2fbe5 (mtd: spi-nor: fsl-quadspi: add support for ls1021a). Signed-off-by: Rasmus Villemoes <rasmus.villem...@prevas.dk> --- arch/arm/boot/dts/ls1021a.dts

[PATCH] ARM: dts: ls1021a: add quadspi node

2018-01-26 Thread Rasmus Villemoes
Add a node to device tree repesenting the QuadSPI controller present on LS1021a. Driver support has been present since e8c034b2fbe5 (mtd: spi-nor: fsl-quadspi: add support for ls1021a). Signed-off-by: Rasmus Villemoes --- arch/arm/boot/dts/ls1021a.dtsi | 14 ++ 1 file changed, 14

Re: [PATCH v2] of: use hash based search in of_find_node_by_phandle

2018-01-26 Thread Rasmus Villemoes
On 2018-01-26 09:31, Chintan Pandya wrote: > Implement, device-phandle relation in hash-table so > that look up can be faster, irrespective of where my > device is defined in the DT. > > There are ~6.7k calls to of_find_node_by_phandle() and > total improvement observed during boot is 400ms. I'm

Re: [PATCH v2] of: use hash based search in of_find_node_by_phandle

2018-01-26 Thread Rasmus Villemoes
On 2018-01-26 09:31, Chintan Pandya wrote: > Implement, device-phandle relation in hash-table so > that look up can be faster, irrespective of where my > device is defined in the DT. > > There are ~6.7k calls to of_find_node_by_phandle() and > total improvement observed during boot is 400ms. I'm

Re: [RFC PATCH] vsprintf: add flag ZEROPAD handling before crng is ready

2018-01-26 Thread Rasmus Villemoes
On 26 January 2018 at 10:17, Andy Shevchenko wrote: > +Rasmus Thanks. > On Fri, 2018-01-26 at 15:39 +0800, Yang Shunyong wrote: >> Before crng is ready, output of "%p" composes of "(ptrval)" and >> left padding spaces for alignment as no random address can be

Re: [RFC PATCH] vsprintf: add flag ZEROPAD handling before crng is ready

2018-01-26 Thread Rasmus Villemoes
On 26 January 2018 at 10:17, Andy Shevchenko wrote: > +Rasmus Thanks. > On Fri, 2018-01-26 at 15:39 +0800, Yang Shunyong wrote: >> Before crng is ready, output of "%p" composes of "(ptrval)" and >> left padding spaces for alignment as no random address can be >> generated. This seems a little

[PATCH v4 2/2] dt/bindings: Add bindings for Layerscape external irqs

2018-01-25 Thread Rasmus Villemoes
This adds Device Tree binding documentation for the external interrupt lines with configurable polarity present on some Layerscape SOCs. Signed-off-by: Rasmus Villemoes <rasmus.villem...@prevas.dk> --- Changes since v3: Add non-empty commit log. .../interrupt-controller/fsl,ls-exti

[PATCH v4 2/2] dt/bindings: Add bindings for Layerscape external irqs

2018-01-25 Thread Rasmus Villemoes
This adds Device Tree binding documentation for the external interrupt lines with configurable polarity present on some Layerscape SOCs. Signed-off-by: Rasmus Villemoes --- Changes since v3: Add non-empty commit log. .../interrupt-controller/fsl,ls-extirq.txt | 44

[PATCH v4 1/2] irqchip: add support for Layerscape external interrupt lines

2018-01-25 Thread Rasmus Villemoes
The LS1021A allows inverting the polarity of six interrupt lines IRQ[0:5] via the scfg_intpcr register, effectively allowing IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_EDGE_FALLING for those. We just need to check the type, set the relevant bit in INTPCR accordingly, and fixup the type argument before

[PATCH v4 1/2] irqchip: add support for Layerscape external interrupt lines

2018-01-25 Thread Rasmus Villemoes
The LS1021A allows inverting the polarity of six interrupt lines IRQ[0:5] via the scfg_intpcr register, effectively allowing IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_EDGE_FALLING for those. We just need to check the type, set the relevant bit in INTPCR accordingly, and fixup the type argument before

Re: [PATCH] lib/strscpy: remove word-at-a-time optimization.

2018-01-24 Thread Rasmus Villemoes
On 2018-01-09 17:47, Andrey Ryabinin wrote: > Attached user space program I used to see the difference. > Usage: > gcc -02 -o strscpy strscpy_test.c > ./strscpy {b|w} src_str_len count > > src_str_len - length of source string in between 1-4096 > count - how many strscpy() to execute.

Re: [PATCH] lib/strscpy: remove word-at-a-time optimization.

2018-01-24 Thread Rasmus Villemoes
On 2018-01-09 17:47, Andrey Ryabinin wrote: > Attached user space program I used to see the difference. > Usage: > gcc -02 -o strscpy strscpy_test.c > ./strscpy {b|w} src_str_len count > > src_str_len - length of source string in between 1-4096 > count - how many strscpy() to execute.

Re: [PATCH] lib/strscpy: remove word-at-a-time optimization.

2018-01-24 Thread Rasmus Villemoes
And we don't use strscpy() > in a performance critical paths to copy large amounts of data, > so it shouldn't matter anyway. > > Fixes: 30035e45753b7 ("string: provide strscpy()") > Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com> > Cc: <sta...@vger.kernel.

Re: [PATCH] lib/strscpy: remove word-at-a-time optimization.

2018-01-24 Thread Rasmus Villemoes
And we don't use strscpy() > in a performance critical paths to copy large amounts of data, > so it shouldn't matter anyway. > > Fixes: 30035e45753b7 ("string: provide strscpy()") > Signed-off-by: Andrey Ryabinin > Cc: > Acked-by: Rasmus Villemoes Your microbenchmark

Re: [mm 4.15-rc8] Random oopses under memory pressure.

2018-01-22 Thread Rasmus Villemoes
On 2018-01-19 19:42, Linus Torvalds wrote: > > I actually asked (long long ago) for an optinal compiler warning for > "pointer subtraction with non-power-of-2 sizes". Not because of it > being undefined, but simply because it's expensive. The > divide->multiply thing doesn't always work, Huh? If

Re: [mm 4.15-rc8] Random oopses under memory pressure.

2018-01-22 Thread Rasmus Villemoes
On 2018-01-19 19:42, Linus Torvalds wrote: > > I actually asked (long long ago) for an optinal compiler warning for > "pointer subtraction with non-power-of-2 sizes". Not because of it > being undefined, but simply because it's expensive. The > divide->multiply thing doesn't always work, Huh? If

[PATCH v3 2/2] dt/bindings: Add bindings for Layerscape external irqs

2018-01-22 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes <rasmus.villem...@prevas.dk> --- .../interrupt-controller/fsl,ls-extirq.txt | 44 ++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/fsl,ls-extirq.txt diff

[PATCH v3 2/2] dt/bindings: Add bindings for Layerscape external irqs

2018-01-22 Thread Rasmus Villemoes
Signed-off-by: Rasmus Villemoes --- .../interrupt-controller/fsl,ls-extirq.txt | 44 ++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/interrupt-controller/fsl,ls-extirq.txt diff --git a/Documentation/devicetree/bindings

[PATCH v3 1/2] irqchip: add support for Layerscape external interrupt lines

2018-01-22 Thread Rasmus Villemoes
The LS1021A allows inverting the polarity of six interrupt lines IRQ[0:5] via the scfg_intpcr register, effectively allowing IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_EDGE_FALLING for those. We just need to check the type, set the relevant bit in INTPCR accordingly, and fixup the type argument before

[PATCH v3 1/2] irqchip: add support for Layerscape external interrupt lines

2018-01-22 Thread Rasmus Villemoes
The LS1021A allows inverting the polarity of six interrupt lines IRQ[0:5] via the scfg_intpcr register, effectively allowing IRQ_TYPE_LEVEL_LOW and IRQ_TYPE_EDGE_FALLING for those. We just need to check the type, set the relevant bit in INTPCR accordingly, and fixup the type argument before

Re: [PATCH] NFSD: hide unused svcxdr_dupstr()

2018-01-19 Thread Rasmus Villemoes
On 2018-01-19 15:54, Arnd Bergmann wrote: > There is now only one caller left for svcxdr_dupstr() and this is inside > of an #ifdef, so we can get a warning when the option is disabled: > > fs/nfsd/nfs4xdr.c:241:1: error: 'svcxdr_dupstr' defined but not used > [-Werror=unused-function] > > This

Re: [PATCH] NFSD: hide unused svcxdr_dupstr()

2018-01-19 Thread Rasmus Villemoes
On 2018-01-19 15:54, Arnd Bergmann wrote: > There is now only one caller left for svcxdr_dupstr() and this is inside > of an #ifdef, so we can get a warning when the option is disabled: > > fs/nfsd/nfs4xdr.c:241:1: error: 'svcxdr_dupstr' defined but not used > [-Werror=unused-function] > > This

Re: [PATCH v2] ARM: dts: ls1021a: add nodes for on-chip ram

2018-01-19 Thread Rasmus Villemoes
On 2018-01-03 16:45, Rasmus Villemoes wrote: > Although the two nodes constitute one contiguous 128K region, still > describe them separately: > > - That's how they are described in the reference manual: "Each OCRAM > occupies a 64 KB of address region...", and the na

<    7   8   9   10   11   12   13   14   15   16   >