Re: [PATCH 10/30] iio: dummy: iio_simple_dummy: Add newline after function-end

2020-07-18 Thread Jonathan Cameron
On Thu, 16 Jul 2020 14:59:08 +0100
Lee Jones  wrote:

> Fixes the following checkpatch.pl warning(s):
> 
>  CHECK: Please use a blank line after function/struct/union/enum declarations
>  #46: FILE: drivers/iio/dummy/iio_simple_dummy.c:690:
>   }
>  +/*
>  total: 0 errors, 0 warnings, 1 checks, 22 lines checked
> 
> Signed-off-by: Lee Jones 
Applied

> ---
>  drivers/iio/dummy/iio_simple_dummy.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/dummy/iio_simple_dummy.c 
> b/drivers/iio/dummy/iio_simple_dummy.c
> index be66b26373723..cc4335963d0cf 100644
> --- a/drivers/iio/dummy/iio_simple_dummy.c
> +++ b/drivers/iio/dummy/iio_simple_dummy.c
> @@ -687,6 +687,7 @@ static int iio_dummy_remove(struct iio_sw_device *swd)
>  
>   return 0;
>  }
> +
>  /*
>   * module_iio_sw_device_driver() -  device driver registration
>   *



Re: [PATCH 09/30] iio: dummy: iio_simple_dummy: Demote unworthy kerneldocs and correct misspelling

2020-07-18 Thread Jonathan Cameron
On Thu, 16 Jul 2020 14:59:07 +0100
Lee Jones  wrote:

> File header comments are not good candidates for kerneldoc.  Neither
> are generic comment blocks.
> 
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/iio/dummy/iio_simple_dummy.c:26: warning: cannot understand function 
> prototype: 'const struct config_item_type iio_dummy_type = '
>  drivers/iio/dummy/iio_simple_dummy.c:564: warning: Function parameter or 
> member 'name' not described in 'iio_dummy_probe'
>  drivers/iio/dummy/iio_simple_dummy.c:564: warning: Excess function parameter 
> 'index' description in 'iio_dummy_probe'
>  drivers/iio/dummy/iio_simple_dummy.c:700: warning: cannot understand 
> function prototype: 'const struct iio_sw_device_ops iio_dummy_device_ops = '
> 
Misspelling is an interesting way of describing that part.  I changed
it to "wrong parameter in docs".

Applied.

> Signed-off-by: Lee Jones 
> ---
>  drivers/iio/dummy/iio_simple_dummy.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/dummy/iio_simple_dummy.c 
> b/drivers/iio/dummy/iio_simple_dummy.c
> index 6cb02299a2152..be66b26373723 100644
> --- a/drivers/iio/dummy/iio_simple_dummy.c
> +++ b/drivers/iio/dummy/iio_simple_dummy.c
> @@ -1,5 +1,5 @@
>  // SPDX-License-Identifier: GPL-2.0-only
> -/**
> +/*
>   * Copyright (c) 2011 Jonathan Cameron
>   *
>   * A reference industrial I/O driver to illustrate the functionality 
> available.
> @@ -553,7 +553,7 @@ static int iio_dummy_init_device(struct iio_dev 
> *indio_dev)
>  
>  /**
>   * iio_dummy_probe() - device instance probe
> - * @index: an id number for this instance.
> + * @name: name of this instance.
>   *
>   * Arguments are bus type specific.
>   * I2C: iio_dummy_probe(struct i2c_client *client,
> @@ -687,7 +687,7 @@ static int iio_dummy_remove(struct iio_sw_device *swd)
>  
>   return 0;
>  }
> -/**
> +/*
>   * module_iio_sw_device_driver() -  device driver registration
>   *
>   * Varies depending on bus type of the device. As there is no device



[PATCH 3/3] x86: Clean up do_fast_syscall_32() tests

2020-07-18 Thread Brian Gerst
Reorganize the tests for SYSEXITS/SYSRETL, cleaning up comments and merging
native and compat code.

Signed-off-by: Brian Gerst 
---
 arch/x86/entry/common.c  | 85 ++--
 arch/x86/entry/entry_32.S|  6 +--
 arch/x86/entry/entry_64_compat.S | 13 ++---
 arch/x86/include/asm/segment.h   |  1 +
 arch/x86/include/asm/syscall.h   |  2 +-
 5 files changed, 48 insertions(+), 59 deletions(-)

diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
index bdb4c15b8610e..df1497fa554b8 100644
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
@@ -500,10 +500,24 @@ __visible noinstr void do_int80_syscall_32(struct pt_regs 
*regs)
exit_to_user_mode();
 }
 
+/* Returns true to return using SYSEXIT/SYSRETL, or false to return using IRET 
*/
 static bool __do_fast_syscall_32(struct pt_regs *regs)
 {
+   /*
+* Called using the internal vDSO SYSENTER/SYSCALL32 calling
+* convention.  Adjust regs so it looks like we entered using int80.
+*/
+   unsigned long landing_pad = (unsigned long)current->mm->context.vdso +
+   vdso_image_32.sym_int80_landing_pad;
int res;
 
+   /*
+* SYSENTER loses EIP, and even SYSCALL32 needs us to skip forward
+* so that 'regs->ip -= 2' lands back on an int $0x80 instruction.
+* Fix it up.
+*/
+   regs->ip = landing_pad;
+
/* Fetch EBP from where the vDSO stashed it. */
if (IS_ENABLED(CONFIG_X86_64)) {
/*
@@ -522,34 +536,39 @@ static bool __do_fast_syscall_32(struct pt_regs *regs)
regs->ax = -EFAULT;
local_irq_disable();
__prepare_exit_to_usermode(regs);
+   /* Keep it simple: use IRET. */
return false;
}
 
/* Now this is just like a normal syscall. */
do_syscall_32_irqs_on(regs);
+
+   /* XEN PV guests always use IRET path */
+   if (static_cpu_has(X86_FEATURE_XENPV))
+   return false;
+
+   /* CS and SS must match values set in MSR_STAR */
+   if (unlikely(regs->cs != __USER32_CS || regs->ss != __USER_DS))
+   return false;
+
+   /* EIP must point to the VDSO landing pad */
+   if (unlikely(regs->ip != landing_pad))
+   return false;
+
+   /* The TF, RF, and VM flags must be restored with IRET */
+   if (unlikely(regs->flags & (X86_EFLAGS_RF | X86_EFLAGS_TF | 
X86_EFLAGS_VM)))
+   return false;
+
+   /* Return with SYSEXIT/SYSRETL */
return true;
 }
 
-/* Returns 0 to return using IRET or 1 to return using SYSEXIT/SYSRETL. */
-__visible noinstr long do_fast_syscall_32(struct pt_regs *regs)
+__visible noinstr bool do_fast_syscall_32(struct pt_regs *regs)
 {
-   /*
-* Called using the internal vDSO SYSENTER/SYSCALL32 calling
-* convention.  Adjust regs so it looks like we entered using int80.
-*/
-   unsigned long landing_pad = (unsigned long)current->mm->context.vdso +
-   vdso_image_32.sym_int80_landing_pad;
bool success;
 
check_user_regs(regs);
 
-   /*
-* SYSENTER loses EIP, and even SYSCALL32 needs us to skip forward
-* so that 'regs->ip -= 2' lands back on an int $0x80 instruction.
-* Fix it up.
-*/
-   regs->ip = landing_pad;
-
enter_from_user_mode();
instrumentation_begin();
 
@@ -559,42 +578,10 @@ __visible noinstr long do_fast_syscall_32(struct pt_regs 
*regs)
instrumentation_end();
exit_to_user_mode();
 
-   /* If it failed, keep it simple: use IRET. */
-   if (!success)
-   return 0;
-
-#ifdef CONFIG_X86_64
-   /*
-* Opportunistic SYSRETL: if possible, try to return using SYSRETL.
-* SYSRETL is available on all 64-bit CPUs, so we don't need to
-* bother with SYSEXIT.
-*
-* Unlike 64-bit opportunistic SYSRET, we can't check that CX == IP,
-* because the ECX fixup above will ensure that this is essentially
-* never the case.
-*/
-   return regs->cs == __USER32_CS && regs->ss == __USER_DS &&
-   regs->ip == landing_pad &&
-   (regs->flags & (X86_EFLAGS_RF | X86_EFLAGS_TF)) == 0;
-#else
-   /*
-* Opportunistic SYSEXIT: if possible, try to return using SYSEXIT.
-*
-* Unlike 64-bit opportunistic SYSRET, we can't check that CX == IP,
-* because the ECX fixup above will ensure that this is essentially
-* never the case.
-*
-* We don't allow syscalls at all from VM86 mode, but we still
-* need to check VM, because we might be returning from sys_vm86.
-*/
-   return regs->cs == __USER_CS && regs->ss == __USER_DS &&
-   regs->ip == landing_pad &&
-   (regs->flags & (X86_EFLAGS_RF | X86_EFLAGS_TF | X86_EFLAGS_VM)) 
== 0;
-#endif
+ 

[PATCH 1/3] x86-64: Move SYSRET validation code to C

2020-07-18 Thread Brian Gerst
Signed-off-by: Brian Gerst 
---
 arch/x86/entry/calling.h   | 10 +
 arch/x86/entry/common.c| 56 ++-
 arch/x86/entry/entry_64.S  | 71 ++
 arch/x86/include/asm/syscall.h |  2 +-
 4 files changed, 60 insertions(+), 79 deletions(-)

diff --git a/arch/x86/entry/calling.h b/arch/x86/entry/calling.h
index 98e4d8886f11c..904477d3e388f 100644
--- a/arch/x86/entry/calling.h
+++ b/arch/x86/entry/calling.h
@@ -147,27 +147,19 @@ For 32-bit we have the following conventions - kernel is 
built with
 
 .endm
 
-.macro POP_REGS pop_rdi=1 skip_r11rcx=0
+.macro POP_REGS pop_rdi=1
popq %r15
popq %r14
popq %r13
popq %r12
popq %rbp
popq %rbx
-   .if \skip_r11rcx
-   popq %rsi
-   .else
popq %r11
-   .endif
popq %r10
popq %r9
popq %r8
popq %rax
-   .if \skip_r11rcx
-   popq %rsi
-   .else
popq %rcx
-   .endif
popq %rdx
popq %rsi
.if \pop_rdi
diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
index 54ad1890aefca..9e01445f6679c 100644
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
@@ -365,9 +365,11 @@ __visible noinstr void syscall_return_slowpath(struct 
pt_regs *regs)
 }
 
 #ifdef CONFIG_X86_64
-__visible noinstr void do_syscall_64(unsigned long nr, struct pt_regs *regs)
+__visible noinstr bool do_syscall_64(unsigned long nr, struct pt_regs *regs)
 {
struct thread_info *ti;
+   long rip;
+   unsigned int shift_rip;
 
check_user_regs(regs);
 
@@ -394,6 +396,58 @@ __visible noinstr void do_syscall_64(unsigned long nr, 
struct pt_regs *regs)
 
instrumentation_end();
exit_to_user_mode();
+
+   /*
+* Check that the register state is valid for using SYSRET to exit
+* to userspace.  Otherwise use the slower IRET exit path.
+*/
+
+   /* SYSRET requires RCX == RIP and R11 = EFLAGS */
+   if (unlikely(regs->cx != regs->ip || regs->r11 != regs->flags))
+   return false;
+
+   /* CS and SS must match values set in MSR_STAR */
+   if (unlikely(regs->cs != __USER_CS || regs->ss != __USER_DS))
+   return false;
+
+   /*
+* On Intel CPUs, SYSRET with non-canonical RCX/RIP will #GP
+* in kernel space.  This essentially lets the user take over
+* the kernel, since userspace controls RSP.
+*
+* Change top bits to match most significant bit (47th or 56th bit
+* depending on paging mode) in the address.
+*/
+   shift_rip = (64 - __VIRTUAL_MASK_SHIFT + 1);
+   rip = (long) regs->ip;
+   rip <<= shift_rip;
+   rip >>= shift_rip;
+   if (unlikely((unsigned long) rip != regs->ip))
+   return false;
+
+   /*
+* SYSCALL clears RF when it saves RFLAGS in R11 and SYSRET cannot
+* restore RF properly. If the slowpath sets it for whatever reason, we
+* need to restore it correctly.
+*
+* SYSRET can restore TF, but unlike IRET, restoring TF results in a
+* trap from userspace immediately after SYSRET.  This would cause an
+* infinite loop whenever #DB happens with register state that satisfies
+* the opportunistic SYSRET conditions.  For example, single-stepping
+* this user code:
+*
+*   movq   $stuck_here, %rcx
+*   pushfq
+*   popq %r11
+*   stuck_here:
+*
+* would never get past 'stuck_here'.
+*/
+   if (unlikely(regs->flags & (X86_EFLAGS_RF|X86_EFLAGS_TF)))
+   return false;
+
+   /* Use SYSRET to exit to userspace */
+   return true;
 }
 #endif
 
diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index fb729f4c4fbc2..b8025a62ac5e8 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -117,80 +117,15 @@ SYM_INNER_LABEL(entry_SYSCALL_64_after_hwframe, 
SYM_L_GLOBAL)
movq%rsp, %rsi
calldo_syscall_64   /* returns with IRQs disabled */
 
-   /*
-* Try to use SYSRET instead of IRET if we're returning to
-* a completely clean 64-bit userspace context.  If we're not,
-* go to the slow exit path.
-*/
-   movqRCX(%rsp), %rcx
-   movqRIP(%rsp), %r11
-
-   cmpq%rcx, %r11  /* SYSRET requires RCX == RIP */
-   jne swapgs_restore_regs_and_return_to_usermode
-
-   /*
-* On Intel CPUs, SYSRET with non-canonical RCX/RIP will #GP
-* in kernel space.  This essentially lets the user take over
-* the kernel, since userspace controls RSP.
-*
-* If width of "canonical tail" ever becomes variable, this will need
-* to be updated to remain correct on both old and new CPUs.
-*
-* Change top bits to match most significant bit (47th or 56th bit

[PATCH 0/3] x86: Clean up SYSRET/SYSEXIT validation

2020-07-18 Thread Brian Gerst
This series cleans up the tests for using the SYSRET or SYSEXIT
instructions on exit from a syscall, moving some code from assembly to C
and merging native and compat tests.

Brian Gerst (3):
  x86-64: Move SYSRET validation code to C
  x86-32: Remove SEP test for SYSEXIT
  x86: Clean up do_fast_syscall_32() tests

 arch/x86/entry/calling.h |  10 +--
 arch/x86/entry/common.c  | 142 ---
 arch/x86/entry/entry_32.S|   6 +-
 arch/x86/entry/entry_64.S|  71 +---
 arch/x86/entry/entry_64_compat.S |  13 +--
 arch/x86/include/asm/segment.h   |   1 +
 arch/x86/include/asm/syscall.h   |   4 +-
 7 files changed, 108 insertions(+), 139 deletions(-)


base-commit: bccf9048549afe54b3c6bc8979ebfddea748da85
-- 
2.26.2



[PATCH 2/3] x86-32: Remove SEP test for SYSEXIT

2020-07-18 Thread Brian Gerst
SEP must be present in order for do_fast_syscall_32() to be called on native
32-bit.  Therefore the check here is redundant.

Signed-off-by: Brian Gerst 
---
 arch/x86/entry/common.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/x86/entry/common.c b/arch/x86/entry/common.c
index 9e01445f6679c..bdb4c15b8610e 100644
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
@@ -587,8 +587,7 @@ __visible noinstr long do_fast_syscall_32(struct pt_regs 
*regs)
 * We don't allow syscalls at all from VM86 mode, but we still
 * need to check VM, because we might be returning from sys_vm86.
 */
-   return static_cpu_has(X86_FEATURE_SEP) &&
-   regs->cs == __USER_CS && regs->ss == __USER_DS &&
+   return regs->cs == __USER_CS && regs->ss == __USER_DS &&
regs->ip == landing_pad &&
(regs->flags & (X86_EFLAGS_RF | X86_EFLAGS_TF | X86_EFLAGS_VM)) 
== 0;
 #endif
-- 
2.26.2



Re: [PATCH 0/2] task_put batching

2020-07-18 Thread Jens Axboe
On 7/18/20 2:32 AM, Pavel Begunkov wrote:
> For my a bit exaggerated test case perf continues to show high CPU
> cosumption by io_dismantle(), and so calling it io_iopoll_complete().
> Even though the patch doesn't yield throughput increase for my setup,
> probably because the effect is hidden behind polling, but it definitely
> improves relative percentage. And the difference should only grow with
> increasing number of CPUs. Another reason to have this is that atomics
> may affect other parallel tasks (e.g. which doesn't use io_uring)
> 
> before:
> io_iopoll_complete: 5.29%
> io_dismantle_req:   2.16%
> 
> after:
> io_iopoll_complete: 3.39%
> io_dismantle_req:   0.465%

Still not seeing a win here, but it's clean and it _should_ work. For
some reason I end up getting the offset in task ref put growing the
fput_many(). Which doesn't (on the surface) make a lot of sense, but
may just mean that we have some weird side effects.

I have applied it, thanks.

-- 
Jens Axboe



Re: [PATCH 08/30] iio: dac: ad5380: Fix kerneldoc attribute formatting for 'lock'

2020-07-18 Thread Jonathan Cameron
On Thu, 16 Jul 2020 14:59:06 +0100
Lee Jones  wrote:

> Kerneldoc expects attributes/parameters to be in '@*.: ' format.
> 
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/iio/dac/ad5380.c:64: warning: Function parameter or member 'lock' 
> not described in 'ad5380_state'
> 
> Cc: Michael Hennerich 
> Signed-off-by: Lee Jones 
Applied.

> ---
>  drivers/iio/dac/ad5380.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c
> index b37e5675f7162..fd33587c5 100644
> --- a/drivers/iio/dac/ad5380.c
> +++ b/drivers/iio/dac/ad5380.c
> @@ -51,7 +51,7 @@ struct ad5380_chip_info {
>   * @vref_reg:vref supply regulator
>   * @vref:actual reference voltage used in uA
>   * @pwr_down:whether the chip is currently in power down mode
> - * @lock lock to protect the data buffer during regmap ops
> + * @lock:lock to protect the data buffer during regmap ops
>   */
>  
>  struct ad5380_state {



Re: [PATCH 07/30] iio: dac: ad5360: Fix kerneldoc attribute formatting for 'lock'

2020-07-18 Thread Jonathan Cameron
On Thu, 16 Jul 2020 14:59:05 +0100
Lee Jones  wrote:

> Kerneldoc expects attributes/parameters to be in '@*.: ' format.
> 
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/iio/dac/ad5360.c:89: warning: Function parameter or member 'lock' 
> not described in 'ad5360_state'
> 
> Cc: Michael Hennerich 
> Signed-off-by: Lee Jones 
Applied.

> ---
>  drivers/iio/dac/ad5360.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/dac/ad5360.c b/drivers/iio/dac/ad5360.c
> index 3e0c9e84e8dab..e2a2473bfed77 100644
> --- a/drivers/iio/dac/ad5360.c
> +++ b/drivers/iio/dac/ad5360.c
> @@ -67,7 +67,7 @@ struct ad5360_chip_info {
>   * @chip_info:   chip model specific constants, available modes 
> etc
>   * @vref_reg:vref supply regulators
>   * @ctrl:control register cache
> - * @lock lock to protect the data buffer during SPI ops
> + * @lock:lock to protect the data buffer during SPI ops
>   * @data:spi transfer buffers
>   */
>  



Re: [PATCH 06/30] iio: adc: ad7923: Demote obvious misuse of kerneldoc to standard comment blocks

2020-07-18 Thread Jonathan Cameron
On Thu, 16 Jul 2020 14:59:04 +0100
Lee Jones  wrote:

> No attempt has been made to document either of the demoted functions here
> 
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/iio/adc/ad7923.c:159: warning: Function parameter or member 
> 'indio_dev' not described in 'ad7923_update_scan_mode'
>  drivers/iio/adc/ad7923.c:159: warning: Function parameter or member 
> 'active_scan_mask' not described in 'ad7923_update_scan_mode'
>  drivers/iio/adc/ad7923.c:202: warning: Function parameter or member 'irq' 
> not described in 'ad7923_trigger_handler'
>  drivers/iio/adc/ad7923.c:202: warning: Function parameter or member 'p' not 
> described in 'ad7923_trigger_handler'
> 
> Cc: Michael Hennerich 
> Cc: Patrick Vasseur 
> Signed-off-by: Lee Jones 
Both functions are static and hence don't need to be kernel-doc based,
hence agree this is the best 'fix'.

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ad7923.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad7923.c b/drivers/iio/adc/ad7923.c
> index 1d124c87c6ace..2a11bc7fdb567 100644
> --- a/drivers/iio/adc/ad7923.c
> +++ b/drivers/iio/adc/ad7923.c
> @@ -151,9 +151,9 @@ static const struct ad7923_chip_info ad7923_chip_info[] = 
> {
>   },
>  };
>  
> -/**
> +/*
>   * ad7923_update_scan_mode() setup the spi transfer buffer for the new scan 
> mask
> - **/
> + */
>  static int ad7923_update_scan_mode(struct iio_dev *indio_dev,
>  const unsigned long *active_scan_mask)
>  {
> @@ -192,12 +192,12 @@ static int ad7923_update_scan_mode(struct iio_dev 
> *indio_dev,
>   return 0;
>  }
>  
> -/**
> +/*
>   * ad7923_trigger_handler() bh of trigger launched polling to ring buffer
>   *
>   * Currently there is no option in this driver to disable the saving of
>   * timestamps within the ring.
> - **/
> + */
>  static irqreturn_t ad7923_trigger_handler(int irq, void *p)
>  {
>   struct iio_poll_func *pf = p;



Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-18 Thread Alan Stern
On Fri, Jul 17, 2020 at 10:28:18PM -0700, Eric Biggers wrote:
> /**
>  * INIT_ONCE() - do one-time initialization
>  * @done: pointer to a 'bool' flag that tracks whether initialization has been
>  *  done yet or not.  Must be false by default.
>  * @mutex: pointer to a mutex to use to synchronize executions of @init_func
>  * @init_func: the one-time initialization function
>  * @...: additional arguments to pass to @init_func (optional)
>  *
>  * This is a more general version of DO_ONCE_BLOCKING() which supports
>  * non-static data by allowing the user to specify their own 'done' flag and
>  * mutex.
>  *
>  * Return: 0 on success (done or already done), or a negative errno value
>  *   returned by @init_func.

It might be worth pointing out explicitly that init_func can be called 
multiple times, if it returns an error.

>  */
> #define INIT_ONCE(done, mutex, init_func, ...)
> \
> ({\
>   int err = 0;\
>   \
>   if (!smp_load_acquire(done)) {  \
>   mutex_lock(mutex);  \
>   if (!*(done)) { \
>   err = init_func(__VA_ARGS__);   \
>   if (!err)   \
>   smp_store_release((done), true);\
>   }   \
>   mutex_unlock(mutex);\
>   }   \
>   err;\
> })

If this macro is invoked in multiple places for the same object (which 
is not unlikely), there is a distinct risk that people will supply 
different mutexes or done variables for the invocations.

IMO a better approach would be to have a macro which, given a variable 
name v, generates an actual init_once_v() function.  Then code wanting 
to use v would call init_once_v() first, with no danger of inconsistent 
usage.  You can fill in the details...

Alan Stern


From Michelle

2020-07-18 Thread Shayma
Hallo, ich hoffe du hast meine Nachricht erhalten.
Ich brauche schnelle Reaktionen
Danke
Michelle


Re: [PATCH 05/30] iio: chemical: sgp30: Add description for sgp_read_cmd()'s 'duration_us'

2020-07-18 Thread Jonathan Cameron
On Thu, 16 Jul 2020 14:59:03 +0100
Lee Jones  wrote:

> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/iio/chemical/sgp30.c:236: warning: Function parameter or member 
> 'duration_us' not described in 'sgp_read_cmd'
> 
> Cc: Andreas Brauchli 
> Cc: Pascal Sachs 
> Signed-off-by: Lee Jones 

Perhaps we can do better on the wording.

> ---
>  drivers/iio/chemical/sgp30.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/chemical/sgp30.c b/drivers/iio/chemical/sgp30.c
> index 403e8803471a9..82e407d48a0aa 100644
> --- a/drivers/iio/chemical/sgp30.c
> +++ b/drivers/iio/chemical/sgp30.c
> @@ -227,6 +227,7 @@ static int sgp_verify_buffer(const struct sgp_data *data,
>   * @cmd: SGP Command to issue
>   * @buf: Raw data buffer to use
>   * @word_count:  Num words to read, excluding CRC bytes
> + * @duration_us: Time to sleep in microseconds

Time taken to sensor to take a reading and data to be ready.

Something like that maybe?  I've not checked the datasheet but from
code that looks to be what this describes..

Jonathan

>   *
>   * Return:   0 on success, negative error otherwise.
>   */



Re: [PATCH 04/30] iio: adc: ad7298: Demote obvious misuse of kerneldoc to standard comment blocks

2020-07-18 Thread Jonathan Cameron
On Thu, 16 Jul 2020 14:59:02 +0100
Lee Jones  wrote:

> No attempt has been made to document either of the demoted functions here.
> 
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/iio/adc/ad7298.c:106: warning: Function parameter or member 
> 'indio_dev' not described in 'ad7298_update_scan_mode'
>  drivers/iio/adc/ad7298.c:106: warning: Function parameter or member 
> 'active_scan_mask' not described in 'ad7298_update_scan_mode'
>  drivers/iio/adc/ad7298.c:154: warning: Function parameter or member 'irq' 
> not described in 'ad7298_trigger_handler'
>  drivers/iio/adc/ad7298.c:154: warning: Function parameter or member 'p' not 
> described in 'ad7298_trigger_handler'
> 
> Cc: Michael Hennerich 
> Signed-off-by: Lee Jones 
As both are static, no particular reason they should have kernel-doc comments
so agreed we are better fixing this one by demoting rather than adding
the missing stuff.
Applied.

> ---
>  drivers/iio/adc/ad7298.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad7298.c b/drivers/iio/adc/ad7298.c
> index dc8d8c5f6ad36..006b6f63cf4e8 100644
> --- a/drivers/iio/adc/ad7298.c
> +++ b/drivers/iio/adc/ad7298.c
> @@ -98,9 +98,9 @@ static const struct iio_chan_spec ad7298_channels[] = {
>   IIO_CHAN_SOFT_TIMESTAMP(8),
>  };
>  
> -/**
> +/*
>   * ad7298_update_scan_mode() setup the spi transfer buffer for the new scan 
> mask
> - **/
> + */
>  static int ad7298_update_scan_mode(struct iio_dev *indio_dev,
>   const unsigned long *active_scan_mask)
>  {
> @@ -144,12 +144,12 @@ static int ad7298_update_scan_mode(struct iio_dev 
> *indio_dev,
>   return 0;
>  }
>  
> -/**
> +/*
>   * ad7298_trigger_handler() bh of trigger launched polling to ring buffer
>   *
>   * Currently there is no option in this driver to disable the saving of
>   * timestamps within the ring.
> - **/
> + */
>  static irqreturn_t ad7298_trigger_handler(int irq, void *p)
>  {
>   struct iio_poll_func *pf = p;



Re: [PATCH] ACPI/PCI: fix array_size.cocci warnings

2020-07-18 Thread Joe Perches
On Sat, 2020-07-18 at 16:01 +0800, kernel test robot wrote:
> From: kernel test robot 
> 
> drivers/acpi/pci_root.c:150:37-38: WARNING: Use ARRAY_SIZE
> 
>  Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element
[]
>  static char *get_osc_desc(u32 bit)
>  {
> - int len = sizeof(pci_osc_control_bit) / sizeof(pci_osc_control_bit[0]);
> + int len = ARRAY_SIZE(pci_osc_control_bit);
>   int i = 0;
>  
>   for (i = 0; i bit)
+   for (i = 0; i < size; i++) {
+   if (word & table->bit)
len += scnprintf(buf + len, sizeof(buf) - len, "%s%s",
-   len ? " " : "", entry->desc);
+   len ? " " : "", table->desc);
+   table++;
+   }
 
dev_info(>device->dev, "_OSC: %s [%s]\n", msg, buf);
 }




Re: [PATCH 03/30] iio: common: ms_sensors: ms_sensors_i2c: Fix misspelling of parameter 'client'

2020-07-18 Thread Jonathan Cameron
On Thu, 16 Jul 2020 14:59:01 +0100
Lee Jones  wrote:

> Probably due to docrot.
> 
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/iio/common/ms_sensors/ms_sensors_i2c.c:186: warning: Function 
> parameter or member 'client' not described in 'ms_sensors_read_serial'
>  drivers/iio/common/ms_sensors/ms_sensors_i2c.c:186: warning: Excess function 
> parameter 'cli' description in 'ms_sensors_read_serial'
> 
> Cc: William Markezana 
> Cc: Ludovic Tancerel 
> Signed-off-by: Lee Jones 
Applied

> ---
>  drivers/iio/common/ms_sensors/ms_sensors_i2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/common/ms_sensors/ms_sensors_i2c.c 
> b/drivers/iio/common/ms_sensors/ms_sensors_i2c.c
> index b52cba1b3c831..b9e2038d05ef4 100644
> --- a/drivers/iio/common/ms_sensors/ms_sensors_i2c.c
> +++ b/drivers/iio/common/ms_sensors/ms_sensors_i2c.c
> @@ -165,7 +165,7 @@ static bool ms_sensors_crc_valid(u32 value)
>  
>  /**
>   * ms_sensors_read_serial() - Serial number read function
> - * @cli: pointer to i2c client
> + * @client:  pointer to i2c client
>   * @sn:  pointer to 64-bits destination value
>   *
>   * Generic i2c serial number read function for Measurement Specialties 
> devices.



Re: [PATCH 02/30] iio: accel: bma220_spi: Do not define 'struct acpi_device_id' when !CONFIG_ACPI

2020-07-18 Thread Jonathan Cameron
On Thu, 16 Jul 2020 14:59:00 +0100
Lee Jones  wrote:

> Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI,
> struct 'bma220_acpi_id' becomes defined but unused.
> 
> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/iio/accel/bma220_spi.c:312:36: warning: ‘bma220_acpi_id’ defined but 
> not used [-Wunused-const-variable=]
>  312 | static const struct acpi_device_id bma220_acpi_id[] = {
>  | ^~
> 
> Cc: Tiberiu Breana 
> Signed-off-by: Lee Jones 
Applied to the togreg branch of iio.git and pushed out as testing for
the autobulders to play with it.

Thanks,

Jonathan

> ---
>  drivers/iio/accel/bma220_spi.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/iio/accel/bma220_spi.c b/drivers/iio/accel/bma220_spi.c
> index cae905039cb62..439618d815594 100644
> --- a/drivers/iio/accel/bma220_spi.c
> +++ b/drivers/iio/accel/bma220_spi.c
> @@ -309,12 +309,14 @@ static const struct spi_device_id bma220_spi_id[] = {
>   {}
>  };
>  
> +#ifdef CONFIG_ACPI
>  static const struct acpi_device_id bma220_acpi_id[] = {
>   {"BMA0220", 0},
>   {}
>  };
>  
>  MODULE_DEVICE_TABLE(spi, bma220_spi_id);
> +#endif
>  
>  static struct spi_driver bma220_driver = {
>   .driver = {



Re: [PATCH 01/30] iio: adc: ad_sigma_delta: Remove unused variable 'ret'

2020-07-18 Thread Jonathan Cameron
On Thu, 16 Jul 2020 14:58:59 +0100
Lee Jones  wrote:

> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/iio/adc/ad_sigma_delta.c: In function ‘ad_sd_trigger_handler’:
>  drivers/iio/adc/ad_sigma_delta.c:405:6: warning: variable ‘ret’ set but not 
> used [-Wunused-but-set-variable]
>  405 | int ret;
>  | ^~~
> 
> Cc: Michael Hennerich 
> Signed-off-by: Lee Jones 
Hi Lee,

My only thought on this one is perhaps we should put a warning in there
if ret isn't as expected.  Still never been one yet so I doubt anyone
minds too much.

Applied to the togreg branch of iio.git and pushed out as testing.
Note there is time for reviews from others before I push this out as
a non rebasing branch.  I'm also going to need to rebase it once
as previous pull hasn't quite gotten into staging/staging-next yet.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ad_sigma_delta.c | 7 ++-
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad_sigma_delta.c 
> b/drivers/iio/adc/ad_sigma_delta.c
> index dd3d54b3bc8bb..f269b926440da 100644
> --- a/drivers/iio/adc/ad_sigma_delta.c
> +++ b/drivers/iio/adc/ad_sigma_delta.c
> @@ -402,7 +402,6 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void *p)
>   unsigned int reg_size;
>   unsigned int data_reg;
>   uint8_t data[16];
> - int ret;
>  
>   memset(data, 0x00, 16);
>  
> @@ -419,14 +418,12 @@ static irqreturn_t ad_sd_trigger_handler(int irq, void 
> *p)
>   case 4:
>   case 2:
>   case 1:
> - ret = ad_sd_read_reg_raw(sigma_delta, data_reg, reg_size,
> - [0]);
> + ad_sd_read_reg_raw(sigma_delta, data_reg, reg_size, [0]);
>   break;
>   case 3:
>   /* We store 24 bit samples in a 32 bit word. Keep the upper
>* byte set to zero. */
> - ret = ad_sd_read_reg_raw(sigma_delta, data_reg, reg_size,
> - [1]);
> + ad_sd_read_reg_raw(sigma_delta, data_reg, reg_size, [1]);
>   break;
>   }
>  



Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-18 Thread Alan Stern
On Sat, Jul 18, 2020 at 12:00:01PM +1000, Dave Chinner wrote:
> Recipes are aimed at people who simply don't understand any of that
> goobledegook. This won't help them -write correct code-.

Indeed.  Perhaps this writeup belongs in a different document (with a 
pointer from the recipes file), and the actual recipe itself should
await the development of a general and robust API.

Alan Stern



Re: [PATCH v16 21/22] mm/pgdat: remove pgdat lru_lock

2020-07-18 Thread Alex Shi



在 2020/7/18 上午5:09, Alexander Duyck 写道:
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index e028b87ce294..4d7df42b32d6 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -6721,7 +6721,6 @@ static void __meminit pgdat_init_internals(struct 
>> pglist_data *pgdat)
>> init_waitqueue_head(>pfmemalloc_wait);
>>
>> pgdat_page_ext_init(pgdat);
>> -   spin_lock_init(>lru_lock);
>> lruvec_init(>__lruvec);
>>  }
>>
> This patch would probably make more sense as part of patch 18 since
> you removed all of the users of this field there.


yes, I just want to a bit of sense of ceremony to remove this huge big lock. :)


Re: [patch V3 01/13] entry: Provide generic syscall entry functionality

2020-07-18 Thread Thomas Gleixner
Andy Lutomirski  writes:
> On Fri, Jul 17, 2020 at 12:29 PM Thomas Gleixner  wrote:
>> The alternative is to play nasty games with TIF_IA32, TIF_ADDR32 and
>> TIF_X32 to free up bits for 32bit and make the flags field 64 bit on 64
>> bit kernels, but I prefer to do the above seperation.
>
> I'm all for cleaning it up, but I don't think any nasty games would be
> needed regardless.  IMO at least the following flags are nonsense and
> don't belong in TIF_anything at all:
>
> TIF_IA32, TIF_X32: can probably be deleted.  Someone would just need
> to finish the work.
> TIF_ADDR32: also probably removable, but I'm less confident.
> TIF_FORCED_TF: This is purely a ptrace artifact and could easily go
> somewhere else entirely.
>
> So getting those five bits back would be straightforward.
>
> FWIW, TIF_USER_RETURN_NOTIFY is a bit of an odd duck: it's an
> entry/exit word *and* a context switch word.  The latter is because
> it's logically a per-cpu flag, not a per-task flag, and the context
> switch code moves it around so it's always set on the running task.

Gah, I missed the context switch thing of that. That stuff is hideous.

Thanks,

   tglx


Re: [PATCH v16 20/22] mm/vmscan: use relock for move_pages_to_lru

2020-07-18 Thread Alex Shi



在 2020/7/18 上午5:44, Alexander Duyck 写道:
>> if (unlikely(PageCompound(page))) {
>> spin_unlock_irq(>lru_lock);
>> +   lruvec = NULL;
>> destroy_compound_page(page);
>> -   spin_lock_irq(>lru_lock);
>> } else
>> list_add(>lru, _to_free);
>>
> It seems like this should just be rolled into patch 19. Otherwise if
> you are wanting to consider it as a "further optimization" type patch
> you might pull some of the optimizations you were pushing in patch 18
> into this patch as well and just call it out as adding relocks where
> there previously were none.

This patch is picked from Hugh Dickin's version in my review. It could be
fine to have a extra patch which no harm for anyone. :)

Thanks
Alex


Re: [PATCH v16 18/22] mm/lru: replace pgdat lru_lock with lruvec lock

2020-07-18 Thread Alex Shi



在 2020/7/18 上午5:38, Alexander Duyck 写道:
>> +   return locked_lruvec;
>> +
>> +   if (locked_lruvec)
>> +   unlock_page_lruvec_irqrestore(locked_lruvec, *flags);
>> +
>> +   return lock_page_lruvec_irqsave(page, flags);
>> +}
>> +
> These relock functions have no users in this patch. It might make
> sense and push this code to patch 19 in your series since that is
> where they are first used. In addition they don't seem very efficient
> as you already had to call mem_cgroup_page_lruvec once, why do it
> again when you could just store the value and lock the new lruvec if
> needed?

Right, it's better to move for late patch.

As to call the func again, mainly it's for code neat.

Thanks!

> 
>>  #ifdef CONFIG_CGROUP_WRITEBACK
>>
>>  struct wb_domain *mem_cgroup_wb_domain(struct bdi_writeback *wb);
>> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
>> index 14c668b7e793..36c1680efd90 100644
>> --- a/include/linux/mmzone.h
>> +++ b/include/linux/mmzone.h
>> @@ -261,6 +261,8 @@ struct lruvec {
>> atomic_long_t   nonresident_age;
>> /* Refaults at the time of last reclaim cycle */
>> unsigned long   refaults;
>> +   /* per lruvec lru_lock for memcg */
>> +   spinlock_t  lru_lock;
>> /* Various lruvec state flags (enum lruvec_flags) */
>> unsigned long   flags;
> Any reason for placing this here instead of at the end of the
> structure? From what I can tell it looks like lruvec is already 128B
> long so placing the lock on the end would put it into the next
> cacheline which may provide some performance benefit since it is
> likely to be bounced quite a bit.

Rong Chen(Cced) once reported a performance regression when the lock at
the end of struct, and move here could remove it.
Although I can't not reproduce. But I trust his report.

...

>>  putback:
>> -   spin_unlock_irq(>zone_pgdat->lru_lock);
>> pagevec_add(_putback, pvec->pages[i]);
>> pvec->pages[i] = NULL;
>> }
>> -   /* tempary disable irq, will remove later */
>> -   local_irq_disable();
>> __mod_zone_page_state(zone, NR_MLOCK, delta_munlocked);
>> -   local_irq_enable();
>> +   if (lruvec)
>> +   unlock_page_lruvec_irq(lruvec);
> So I am not a fan of this change. You went to all the trouble of
> reducing the lock scope just to bring it back out here again. In
> addition it implies there is a path where you might try to update the
> page state without disabling interrupts.

Right. but any idea to avoid this except a extra local_irq_disable?

...

>> if (PageLRU(page)) {
>> -   struct pglist_data *pgdat = page_pgdat(page);
>> +   struct lruvec *new_lruvec;
>>
>> -   if (pgdat != locked_pgdat) {
>> -   if (locked_pgdat)
>> -   
>> spin_unlock_irqrestore(_pgdat->lru_lock,
>> +   new_lruvec = mem_cgroup_page_lruvec(page,
>> +   page_pgdat(page));
>> +   if (new_lruvec != lruvec) {
>> +   if (lruvec)
>> +   unlock_page_lruvec_irqrestore(lruvec,
>> 
>> flags);
>> lock_batch = 0;
>> -   locked_pgdat = pgdat;
>> -   spin_lock_irqsave(_pgdat->lru_lock, 
>> flags);
>> +   lruvec = lock_page_lruvec_irqsave(page, 
>> );
>> }
> This just kind of seems ugly to me. I am not a fan of having to fetch
> the lruvec twice when you already have it in new_lruvec. I suppose it
> is fine though since you are just going to be replacing it later
> anyway.
> 

yes, it will be reproduce later.

Thanks
Alex


Re: [PATCH] tools/memory-model: document the "one-time init" pattern

2020-07-18 Thread Alan Stern
> This is one of the reasons that the LKMM documetnation is so damn
> difficult to read and understand: just understanding the vocabulary
> it uses requires a huge learning curve, and it's not defined
> anywhere. Understanding the syntax of examples requires a huge
> learning curve, because it's not defined anywhere. 

Have you seen tools/memory-model/Documentation/explanation.txt?  That
file was specifically written for non-experts to help them overcome the
learning curve.  It tries to define the vocabulary as terms are
introduced and to avoid using obscure syntax.

If you think it needs improvement and can give some specific details
about where it falls short, I would like to hear them.

Alan Stern


My Greetings

2020-07-18 Thread Mrs. Anna H. Bruun
My Dear

My Name is Mrs. Anna H. Bruun, from Norway. I know that this message
will be a surprise to you. Firstly, I am married to Mr. Patrick Bruun,
A gold merchant who owns a small gold Mine in Burkina Faso; He died of
Cardiovascular Disease in mid-March 2011. During his life time he
deposited the sum of € 8.5 Million Euro) Eight million, Five hundred
thousand Euros in a bank in Ouagadougou the capital city of Burkina
Faso. The deposited money was from the sale of the shares, death
benefits payment and entitlements of my deceased husband by his
company.

I am sending this message to you praying that it will reach you in
good health, since I am not in good health condition in which I sleep
every night without knowing if I may be alive to see the next day. I
am suffering from long time cancer and presently i am partially
suffering from a stroke illness which has become almost impossible for
me to move around. I am married to my late husband for over 4 years
before he died and is unfortunately that we don't have a child, my
doctor confided in me that i have less chance to live. Having known my
health condition, I decided to contact you to claim the fund since I
don't have any relation I grew up from the orphanage home,

I have decided to donate what I have to you for the support of helping
Motherless babies/Less privileged/Widows' because I am dying and
diagnosed of cancer for about 2 years ago. I have been touched by God
Almighty to donate from what I have inherited from my late husband to
you for good work of God Almighty. I have asked Almighty God to
forgive me and believe he has, because He is a Merciful God I will be
going in for an operation surgery soon

This is the reason i need your services to stand as my next of kin or
an executor to claim the funds for charity purposes. If this money
remains unclaimed after my death, the bank executives or the
government will take the money as unclaimed fund and maybe use it for
selfish and worthless ventures, I need a very honest person who can
claim this money and use it for Charity works, for orphanages, widows
and also build schools for less privilege that will be named after my
late husband and my name; I need your urgent answer to know if you
will be able to execute this project, and I will give you more
Information on how the fund will be transferred to your bank account.

Thanks
Mrs. Anna H.


[PATCH] jbd2: check bh2jh() before accessing it

2020-07-18 Thread Xianting Tian
We met a crash issue when testing nbd device on kernel 4.14.0-115,
the scenario of the issue is "nbd device disconnected before unmounting
ext4 filesystem".
The call trace of the crash as below:
[346961.426274] block nbd2: Connection timed out
[346961.426943] EXT4-fs warning (device nbd2): ext4_end_bio:323: I/O error 10 
writing to inode 5768758
(offset 155926528 size 8192 starting block 8998070)
[346961.426957] Aborting journal on device nbd2-8.
[346961.427027] EXT4-fs error (device nbd2) in __ext4_new_inode:927: Readonly 
filesystem
 ... ...
[346961.437288] Buffer I/O error on dev nbd2, logical block 13139968, lost sync 
page write
[346961.437878] JBD2: Error -5 detected when updating journal superblock for 
nbd2-8.
[346961.438478] BUG: unable to handle kernel NULL pointer dereference at 
0008
[346961.452495] RIP: 0010:jbd2_journal_grab_journal_head+0x1e/0x40 [jbd2]  <== 
crash code offset is 0x1e(30)
[346961.453457] RSP: 0018:c9000ffbbca8 EFLAGS: 00010206
[346961.454414] RAX:  RBX: 881dafe04960 RCX: 
881aee5b0ac8
[346961.455378] RDX: 881df7768690 RSI: 88100a5e9800 RDI: 
880a22593d40
[346961.456360] RBP: c9000ffbbca8 R08: 881dafe04960 R09: 
00018040001c
[346961.457332] R10: 2fe92601 R11: 88202fe90700 R12: 
88100a5e9800
[346961.458302] R13:  R14: 880a22593d40 R15: 
881dafe04960
[346961.459269] FS:  () GS:88103e5c() 
knlGS:
[346961.460250] CS:  0010 DS:  ES:  CR0: 80050033
[346961.461216] CR2: 0008 CR3: 01c09004 CR4: 
007606e0
[346961.462201] DR0:  DR1:  DR2: 

[346961.463164] DR3:  DR6: fffe0ff0 DR7: 
0400
[346961.465047] Call Trace:
[346961.465981]  __jbd2_journal_insert_checkpoint+0x28/0x80 [jbd2]
[346961.466907]  jbd2_journal_commit_transaction+0x1185/0x1a20 [jbd2]
[346961.467862]  ? lock_timer_base+0x7d/0xa0
[346961.468794]  kjournald2+0xd2/0x260 [jbd2]
[346961.469717]  ? remove_wait_queue+0x60/0x60
[346961.470630]  kthread+0x109/0x140
[346961.471533]  ? commit_timeout+0x10/0x10 [jbd2]
[346961.472438]  ? kthread_park+0x60/0x60
[346961.473521]  ? do_syscall_64+0x182/0x1b0
[346961.474546]  ret_from_fork+0x25/0x30

Analysis of the crash code as below:
struct journal_head *jbd2_journal_grab_journal_head(struct buffer_head *bh)
{
struct journal_head *jh = NULL;

jbd_lock_bh_journal_head(bh);
if (buffer_jbd(bh)) {
jh = bh2jh(bh); <== jh is NULL (bh->b_private = NULL)
jh->b_jcount++; <== crash here!!!
b_jcount offset in 'struct journal_head' is 
0x8
}
jbd_unlock_bh_journal_head(bh);
return jh;
}

crash> dis -l jbd2_journal_grab_journal_head
0xa00b6050 :nopl   0x0(%rax,%rax,1) 
[FTRACE NOP]
0xa00b6055 :  push   %rbp
0xa00b6056 :  mov%rsp,%rbp
0xa00b6059 :  lock btsl $0x18,(%rdi)
0xa00b605e : jb 
0xa00b6079 
0xa00b6060 : mov(%rdi),%rax
0xa00b6063 : test   $0x2,%eax
0xa00b6068 : je 
0xa00b6087 
0xa00b606a : mov0x40(%rdi),%rax  
<== jh is NULL(b_private's offset in 'struct buffer_head' is 0x40)
0xa00b606e : addl   $0x1,0x8(%rax)  
<== "jh->b_jcount++" crash!!!

According to the logical in above code, buffer_head has an attached
journal_head("buffer_jbd(bh)" is true), but buffer_head doesn't record
it(bh->b_private is NULL).
So testing if "buffer_jbd(bh)" is true can't guarantee "bh->b_private"
is not NULL under the abnormal test case.

Signed-off-by: Xianting Tian 
---
 fs/jbd2/journal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index e494443..cb661d4 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -2535,7 +2535,7 @@ struct journal_head 
*jbd2_journal_grab_journal_head(struct buffer_head *bh)
struct journal_head *jh = NULL;
 
jbd_lock_bh_journal_head(bh);
-   if (buffer_jbd(bh)) {
+   if (buffer_jbd(bh) && bh2jh(bh)) {
jh = bh2jh(bh);
jh->b_jcount++;
}
-- 
1.8.3.1



Re: [PATCH v16 19/22] mm/lru: introduce the relock_page_lruvec function

2020-07-18 Thread Alex Shi



在 2020/7/18 上午6:03, Alexander Duyck 写道:
>> index 129c532357a4..9fb906fbaed5 100644
>> --- a/mm/swap.c
>> +++ b/mm/swap.c
>> @@ -209,19 +209,12 @@ static void pagevec_lru_move_fn(struct pagevec *pvec,
>>
>> for (i = 0; i < pagevec_count(pvec); i++) {
>> struct page *page = pvec->pages[i];
>> -   struct lruvec *new_lruvec;
>> -
>> -   new_lruvec = mem_cgroup_page_lruvec(page, page_pgdat(page));
>> -   if (lruvec != new_lruvec) {
>> -   if (lruvec)
>> -   unlock_page_lruvec_irqrestore(lruvec, flags);
>> -   lruvec = lock_page_lruvec_irqsave(page, );
>> -   }
>>
>> /* block memcg migration during page moving between lru */
>> if (!TestClearPageLRU(page))
>> continue;
>>
>> +   lruvec = relock_page_lruvec_irqsave(page, lruvec, );
>> (*move_fn)(page, lruvec);
>>
>> SetPageLRU(page);
> So looking at this I realize that patch 18 probably should have
> ordered this the same way with the TestClearPageLRU happening before
> you fetched the new_lruvec. Otherwise I think you are potentially
> exposed to the original issue you were fixing the the previous patch
> that added the call to TestClearPageLRU.

Good catch. It's better to be aligned in next version.
Thanks!

> 
>> @@ -866,17 +859,12 @@ void release_pages(struct page **pages, int nr)
>> }
>>
>> if (PageLRU(page)) {
>> -   struct lruvec *new_lruvec;
>> -
>> -   new_lruvec = mem_cgroup_page_lruvec(page,
>> -   page_pgdat(page));
>> -   if (new_lruvec != lruvec) {
>> -   if (lruvec)
>> -   unlock_page_lruvec_irqrestore(lruvec,
>> -   
>> flags);
>> +   struct lruvec *pre_lruvec = lruvec;
>> +
>> +   lruvec = relock_page_lruvec_irqsave(page, lruvec,
>> +   
>> );
>> +   if (pre_lruvec != lruvec)
> So this doesn't really read right. I suppose "pre_lruvec" should
> probably be "prev_lruvec" since I assume you mean "previous" not
> "before".

yes, it's previous, I will rename it.
Thanks
Alex
> 


Re: [PATCH v6 2/2] clocksource: Ingenic: Add support for the Ingenic X1000 OST.

2020-07-18 Thread Zhou Yanjie

Hello Paul and Daniel,

在 2020/7/18 下午9:12, Paul Cercueil 写道:

Hi Daniel,

Le ven. 17 juil. 2020 à 10:02, Daniel Lezcano 
 a écrit :

On 17/07/2020 08:13, Zhou Yanjie wrote:

 Hi Daniel,

 在 2020/7/17 下午12:20, Daniel Lezcano 写道:

 On 10/07/2020 19:02, 周琰杰 (Zhou Yanjie) wrote:

 X1000 and SoCs after X1000 (such as X1500 and X1830) had a separate
 OST, it no longer belongs to TCU. This driver will register both a
 clocksource and a sched_clock to the system.

 Tested-by: 周正 (Zhou Zheng) 
 Co-developed-by: 漆鹏振 (Qi Pengzhen) 
 Signed-off-by: 漆鹏振 (Qi Pengzhen) 
 Signed-off-by: 周琰杰 (Zhou Yanjie) 
 Reviewed-by: Paul Cercueil 
 ---

 Notes:
  v1->v2:
  Fix compile warnings.
  Reported-by: kernel test robot 
   v2->v3:
  No change.
   v3->v4:
  1.Rename "ost" to "sysost"
  1.Remove unrelated changes.
  2.Remove ost_clock_parent enum.
  3.Remove ost->percpu_timer_channel/ost->global_timer_channel.
  4.Set up independent .recalc_rate/.set_rate for percpu/global
 timer.
  5.No longer call functions in variable declarations.
   v4->v5:
  Use "of_io_request_and_map()" instead "of_iomap()".
  Suggested-by: Paul Cercueil 
   v5->v6:
  No change.

   drivers/clocksource/Kconfig  |  11 +
   drivers/clocksource/Makefile |   1 +
   drivers/clocksource/ingenic-sysost.c | 539
 +++
   3 files changed, 551 insertions(+)
   create mode 100644 drivers/clocksource/ingenic-sysost.c

 diff --git a/drivers/clocksource/Kconfig 
b/drivers/clocksource/Kconfig

 index 91418381fcd4..1bca8b8fb30f 100644
 --- a/drivers/clocksource/Kconfig
 +++ b/drivers/clocksource/Kconfig
 @@ -696,6 +696,17 @@ config INGENIC_TIMER
   help
 Support for the timer/counter unit of the Ingenic JZ SoCs.
   +config INGENIC_SYSOST
 +    bool "Clocksource/timer using the SYSOST in Ingenic X SoCs"
 We usually use silent options and let the platform's Kconfig 
enable it.

 We show up the option only when COMPILE_TEST is enabled.

 Is there a reason to do it differently?



 Do you mean

 bool "Clocksource/timer using the SYSOST in Ingenic X SoCs"

 or

 default MACH_INGENIC ?


Both, no default here.

eg.

bool "Clocksource/timer using the SYSOST in Ingenic X SoCs" if 
COMPILE_TEST


and

in arch/mips/Kconfig in the config MACH_INGENIC section :

...
select INGENIC_SYSOST
...


Disagreed. That's not how we do things on MIPS. Selecting MACH_INGENIC 
means "this kernel will support Ingenic SoCs", but not that it will 
only support these. Hence the depends on MIPS / default MACH_INGENIC.


As for the select INGENIC_SYSOST, this driver only applies to a few 
SoCs, I certainly don't want it to be force-enabled. I don't even wait 
it to be force-enabled on X1000, since it is optional there too.


Cheers,
-Paul



If we still need to keep the "default MACH_INGENIC", then Daniel can 
directly apply the v6 version.


If we need to use the silent options, maybe we can enable them 
separately according to 
MACH_JZ4740/MACH_JZ4770/MACH_JZ4780/MACH_X1000/MACH_X1830.


In fact, I think X1000 and X1830 need to enable this driver in most 
cases, because the current test has found that use TCU to provide 
clocksource and clockevent will cause data loss/error when transmitting 
data through spi or ethernet. And these errors no longer appear after 
using OST.


Thanks and best regards!







 This driver has some origins from "INGENIC_TIMER" driver and
 "INGENIC_OST" driver.
 Early Ingenic processors used TCU (timer/counter unit, has 6 or 8
 generic timer channels) to provide clocksource and clockevent (both 
with

 only 16bit precision). This part of the processor can only use
 "INGENIC_TIMER" driver.

 Later processors provide an independent 32bit or 64bit timer channel
 (still under TCU, known as ost channel, this channel can not generate
 interrupt) to provid higher precision clocksource. The "INGENIC_OST"
 driver is for this channel. These processors can use "INGENIC_TIMER"
 driver, but using "INGENIC_OST" driver to provide higher precision
 clocksource would be a better choice (clockevent still needs to be
 provided by generic timer channel of TCU, and still 16bit precision).

 And the recent processors provide a SYSOST components, it is 
independent

 from TCU, including a 64bit timer channel for clocksource and a 32bit
 timer channel for clockevent. Although these processors can also use
 "INGENIC_TIMER" driver, but the better choice is completely 
independent

 use of "INGENIC_SYSOST" driver to provide higher precision clocksource
 and clockevent.


Ok, the rating should do the job then.

Thanks for the explanation.


 You may have already noticed that this independent SYSOST component is
 like an upgraded and streamlined TCU, which only retains one generic
 timer channel that can generate interrupts, upgrade it from 16bit to
 32bit, and then retain the 64bit ost channel. so the driver code and
 Kconfig code of this patch is largely 

Re: [PATCH v5 14/15] vfio: Document dual stage control

2020-07-18 Thread Auger Eric
Hi Yi,

On 7/12/20 1:21 PM, Liu Yi L wrote:
> From: Eric Auger 
> 
> The VFIO API was enhanced to support nested stage control: a bunch of
> new iotcls and usage guideline.
ioctls
> 
> Let's document the process to follow to set up nested mode.
> 
> Cc: Kevin Tian 
> CC: Jacob Pan 
> Cc: Alex Williamson 
> Cc: Eric Auger 
> Cc: Jean-Philippe Brucker 
> Cc: Joerg Roedel 
> Cc: Lu Baolu 
> Reviewed-by: Stefan Hajnoczi 
> Signed-off-by: Eric Auger 
> Signed-off-by: Liu Yi L 
> ---
> v3 -> v4:
> *) add review-by from Stefan Hajnoczi
> 
> v2 -> v3:
> *) address comments from Stefan Hajnoczi
> 
> v1 -> v2:
> *) new in v2, compared with Eric's original version, pasid table bind
>and fault reporting is removed as this series doesn't cover them.
>Original version from Eric.
>https://lkml.org/lkml/2020/3/20/700
> ---
>  Documentation/driver-api/vfio.rst | 67 
> +++
>  1 file changed, 67 insertions(+)
> 
> diff --git a/Documentation/driver-api/vfio.rst 
> b/Documentation/driver-api/vfio.rst
> index f1a4d3c..0672c45 100644
> --- a/Documentation/driver-api/vfio.rst
> +++ b/Documentation/driver-api/vfio.rst
> @@ -239,6 +239,73 @@ group and can access them as follows::
>   /* Gratuitous device reset and go... */
>   ioctl(device, VFIO_DEVICE_RESET);
>  
> +IOMMU Dual Stage Control
> +
> +
> +Some IOMMUs support 2 stages/levels of translation. Stage corresponds to
> +the ARM terminology while level corresponds to Intel's VTD terminology.
> +In the following text we use either without distinction.
> +
> +This is useful when the guest is exposed with a virtual IOMMU and some
> +devices are assigned to the guest through VFIO. Then the guest OS can use
> +stage 1 (GIOVA -> GPA or GVA->GPA), while the hypervisor uses stage 2 for
> +VM isolation (GPA -> HPA).
> +
> +Under dual stage translation, the guest gets ownership of the stage 1 page
> +tables and also owns stage 1 configuration structures. The hypervisor owns
> +the root configuration structure (for security reason), including stage 2
> +configuration. This works as long as configuration structures and page table
> +formats are compatible between the virtual IOMMU and the physical IOMMU.
> +
> +Assuming the HW supports it, this nested mode is selected by choosing the
> +VFIO_TYPE1_NESTING_IOMMU type through:
> +
> +ioctl(container, VFIO_SET_IOMMU, VFIO_TYPE1_NESTING_IOMMU);
> +
> +This forces the hypervisor to use the stage 2, leaving stage 1 available
> +for guest usage. The guest stage 1 format depends on IOMMU vendor, and
> +it is the same with the nesting configuration method. User space should
> +check the format and configuration method after setting nesting type by
> +using:
> +
> +ioctl(container->fd, VFIO_IOMMU_GET_INFO, _info);
> +
> +Details can be found in Documentation/userspace-api/iommu.rst. For Intel
> +VT-d, each stage 1 page table is bound to host by:
> +
> +nesting_op->flags = VFIO_IOMMU_NESTING_OP_BIND_PGTBL;
> +memcpy(_op->data, _data, sizeof(bind_data));
> +ioctl(container->fd, VFIO_IOMMU_NESTING_OP, nesting_op);
> +
> +As mentioned above, guest OS may use stage 1 for GIOVA->GPA or GVA->GPA.
the guest OS, here and below?
> +GVA->GPA page tables are available when PASID (Process Address Space ID)
> +is exposed to guest. e.g. guest with PASID-capable devices assigned. For
> +such page table binding, the bind_data should include PASID info, which
> +is allocated by guest itself or by host. This depends on hardware vendor.
> +e.g. Intel VT-d requires to allocate PASID from host. This requirement is

> +defined by the Virtual Command Support in VT-d 3.0 spec, guest software
> +running on VT-d should allocate PASID from host kernel.
because VTD 3.0 requires the unicity of the PASID, system wide, instead
of the above repetition.

 To allocate PASID
> +from host, user space should check the IOMMU_NESTING_FEAT_SYSWIDE_PASID
> +bit of the nesting info reported from host kernel. VFIO reports the nesting
> +info by VFIO_IOMMU_GET_INFO. User space could allocate PASID from host by:
if SYSWIDE_PASID requirement is exposed, the userspace *must* allocate ...
> +
> +req.flags = VFIO_IOMMU_ALLOC_PASID;
> +ioctl(container, VFIO_IOMMU_PASID_REQUEST, );
> +
> +With first stage/level page table bound to host, it allows to combine the
> +guest stage 1 translation along with the hypervisor stage 2 translation to
> +get final address.
> +
> +When the guest invalidates stage 1 related caches, invalidations must be
> +forwarded to the host through
> +
> +nesting_op->flags = VFIO_IOMMU_NESTING_OP_CACHE_INVLD;
> +memcpy(_op->data, _data, sizeof(inv_data));
> +ioctl(container->fd, VFIO_IOMMU_NESTING_OP, nesting_op);
> +
> +Those invalidations can happen at various granularity levels, page, context,
> +...
> +
>  VFIO User API
>  
> ---
I see you dropped the unrecoverable error 

[PATCH] staging: kpc2000: Replace depracated MSI API.

2020-07-18 Thread Suraj Upadhyay
Replace depracated pci_enable_msi with pci_alloc_irq_vectors.

Signed-off-by: Suraj Upadhyay 
---
 drivers/staging/kpc2000/kpc2000/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/kpc2000/kpc2000/core.c 
b/drivers/staging/kpc2000/kpc2000/core.c
index 358d7b2f4ad1..bf21cdc5546f 100644
--- a/drivers/staging/kpc2000/kpc2000/core.c
+++ b/drivers/staging/kpc2000/kpc2000/core.c
@@ -440,7 +440,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev,
dev_dbg(>pdev->dev,
"Using DMA mask %0llx\n", dma_get_mask(PCARD_TO_DEV(pcard)));
 
-   err = pci_enable_msi(pcard->pdev);
+   err = pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_MSI);
if (err < 0)
goto err_release_dma;
 
-- 
2.17.1



signature.asc
Description: PGP signature


[PATCH] tty: vt: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 Documentation/driver-api/serial/n_gsm.rst | 2 +-
 drivers/tty/vt/vt.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/driver-api/serial/n_gsm.rst 
b/Documentation/driver-api/serial/n_gsm.rst
index 286e7ff4d2d9..87dfcd54a96b 100644
--- a/Documentation/driver-api/serial/n_gsm.rst
+++ b/Documentation/driver-api/serial/n_gsm.rst
@@ -5,7 +5,7 @@ GSM 0710 tty multiplexor HOWTO
 This line discipline implements the GSM 07.10 multiplexing protocol
 detailed in the following 3GPP document:
 
-   http://www.3gpp.org/ftp/Specs/archive/07_series/07.10/0710-720.zip
+   https://www.3gpp.org/ftp/Specs/archive/07_series/07.10/0710-720.zip
 
 This document give some hints on how to use this driver with GPRS and 3G
 modems connected to a physical serial port.
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 48a8199f7845..df8a25fabedf 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -2530,7 +2530,7 @@ static void do_con_trol(struct tty_struct *tty, struct 
vc_data *vc, int c)
 
 /* is_double_width() is based on the wcwidth() implementation by
  * Markus Kuhn -- 2007-05-26 (Unicode 5.0)
- * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
+ * Latest version: https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
  */
 struct interval {
uint32_t first;
-- 
2.27.0



Re: [PATCH 4/4] staging: rtl8188eu: include: placed constant on the right side of the test in comparisons

2020-07-18 Thread B K Karthik
On Sat, Jul 18, 2020 at 9:17 AM Joe Perches  wrote:
>
> On Sat, 2020-07-18 at 05:18 -0400, B K Karthik wrote:
> > placed constant on the right side of the test
> > to fix warnings issued by checkpatch
> []
> > diff --git a/drivers/staging/rtl8188eu/include/wifi.h 
> > b/drivers/staging/rtl8188eu/include/wifi.h
> []
> > @@ -326,7 +326,7 @@ static inline unsigned char *get_hdr_bssid(unsigned 
> > char *pframe)
> >
> >  static inline int IsFrameTypeCtrl(unsigned char *pframe)
> >  {
> > - if (WIFI_CTRL_TYPE == GetFrameType(pframe))
> > + if (GetFrameType(pframe) == WIFI_CTRL_TYPE)
> >   return true;
> >   else
> >   return false;
>
> Always try to improve code instead of merely shutting
> up checkpatch warnings.
>
> This function should likely be written:
>
> static inline bool IsFrameTypeCtrl(unsigned char *pframe)
> {
> return GetFrameType(pframe) == WIFI_CTRL_TYPE;
> }
>
> and given it's used only once, it might be expanded
> in that place and removed altogether.
>
> Something like:
>
> (and the memcmp below could be ether_addr_equal instead
>  but I'm too lazy to find out if the addresses are both
>  guaranteed to be __aligned(2) which is likely)

Alright, I will try to do that and send a v2 asap :)
>
> ---
>  drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c | 8 +---
>  drivers/staging/rtl8188eu/include/wifi.h| 7 ---
>  2 files changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c 
> b/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c
> index 7d0135fde795..a2994f9ecbde 100644
> --- a/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c
> +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c
> @@ -144,10 +144,12 @@ void update_recvframe_phyinfo_88e(struct recv_frame 
> *precvframe,
>
> wlanhdr = precvframe->pkt->data;
>
> -   pkt_info.bPacketMatchBSSID = ((!IsFrameTypeCtrl(wlanhdr)) &&
> -   !pattrib->icv_err && !pattrib->crc_err &&
> +   pkt_info.bPacketMatchBSSID =
> +   GetFrameType(wlanhdr) != WIFI_CTRL_TYPE &&
> +   !pattrib->icv_err &&
> +   !pattrib->crc_err &&
> !memcmp(get_hdr_bssid(wlanhdr),
> -get_bssid(>mlmepriv), ETH_ALEN));
> +   get_bssid(>mlmepriv), ETH_ALEN);
>
> pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID &&
>  (!memcmp(get_da(wlanhdr),
> diff --git a/drivers/staging/rtl8188eu/include/wifi.h 
> b/drivers/staging/rtl8188eu/include/wifi.h
> index 791f287a546d..3998d5633860 100644
> --- a/drivers/staging/rtl8188eu/include/wifi.h
> +++ b/drivers/staging/rtl8188eu/include/wifi.h
> @@ -324,13 +324,6 @@ static inline unsigned char *get_hdr_bssid(unsigned char 
> *pframe)
> return sa;
>  }
>
> -static inline int IsFrameTypeCtrl(unsigned char *pframe)
> -{
> -   if (WIFI_CTRL_TYPE == GetFrameType(pframe))
> -   return true;
> -   else
> -   return false;
> -}
>  
> /*-
> Below is for the security related definition
>  
> --*/

thank you for pointing me.

karthik


[PATCH] staging: media: ipu3: Replace depracated MSI API.

2020-07-18 Thread Suraj Upadhyay
Replace depracated psi_enable_msi with pci_alloc_irq_vectors.
And as a result modify how the returned value is handled.

Signed-off-by: Suraj Upadhyay 
---
 drivers/staging/media/ipu3/ipu3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/ipu3/ipu3.c 
b/drivers/staging/media/ipu3/ipu3.c
index ee1bba6bdcac..54690e7442be 100644
--- a/drivers/staging/media/ipu3/ipu3.c
+++ b/drivers/staging/media/ipu3/ipu3.c
@@ -602,9 +602,9 @@ static irqreturn_t imgu_isr(int irq, void *imgu_ptr)
 static int imgu_pci_config_setup(struct pci_dev *dev)
 {
u16 pci_command;
-   int r = pci_enable_msi(dev);
+   int r = pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_MSI);
 
-   if (r) {
+   if (r < 0) {
dev_err(>dev, "failed to enable MSI (%d)\n", r);
return r;
}
-- 
2.17.1



signature.asc
Description: PGP signature


Re: Re: [PATCH v18 02/14] mm: Introduce Data Access MONitor (DAMON)

2020-07-18 Thread SeongJae Park
On Fri, 17 Jul 2020 19:47:50 -0700 Shakeel Butt  wrote:

> On Mon, Jul 13, 2020 at 1:43 AM SeongJae Park  wrote:
> >
> > From: SeongJae Park 
> >
> > DAMON is a data access monitoring framework subsystem for the Linux
> > kernel.  The core mechanisms of DAMON make it
> >
> >  - accurate (the monitoring output is useful enough for DRAM level
> >memory management; It might not appropriate for CPU Cache levels,
> >though),
> >  - light-weight (the monitoring overhead is low enough to be applied
> >online), and
> >  - scalable (the upper-bound of the overhead is in constant range
> >regardless of the size of target workloads).
> >
> > Using this framework, therefore, the kernel's memory management
> > mechanisms can make advanced decisions.  Experimental memory management
> > optimization works that incurring high data accesses monitoring overhead
> > could implemented again.  In user space, meanwhile, users who have some
> > special workloads can write personalized applications for better
> > understanding and optimizations of their workloads and systems.
> >
> > This commit is implementing only the stub for the module load/unload,
> > basic data structures, and simple manipulation functions of the
> > structures to keep the size of commit small.  The core mechanisms of
> > DAMON will be implemented one by one by following commits.
> >
> > Signed-off-by: SeongJae Park 
> > Reviewed-by: Leonard Foerster 
> > Reviewed-by: Varad Gautam 
> > ---
> >  include/linux/damon.h |  63 ++
> >  mm/Kconfig|  12 +++
> >  mm/Makefile   |   1 +
> >  mm/damon.c| 188 ++
> >  4 files changed, 264 insertions(+)
> >  create mode 100644 include/linux/damon.h
> >  create mode 100644 mm/damon.c
> >
> > diff --git a/include/linux/damon.h b/include/linux/damon.h
> > new file mode 100644
> > index ..c8f8c1c41a45
> > --- /dev/null
> > +++ b/include/linux/damon.h
> > @@ -0,0 +1,63 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +/*
> > + * DAMON api
> > + *
> > + * Copyright 2019-2020 Amazon.com, Inc. or its affiliates.
> > + *
> > + * Author: SeongJae Park 
> > + */
> > +
[...]
> > +
> > +/**
> > + * struct damon_task - Represents a monitoring target task.
> > + * @pid:   Process id of the task.
> > + * @regions_list:  Head of the monitoring target regions of this task.
> > + * @list:  List head for siblings.
> > + *
> > + * If the monitoring target address space is task independent (e.g., 
> > physical
> > + * memory address space monitoring), @pid should be '-1'.
> > + */
> > +struct damon_task {
> > +   int pid;
> 
> Storing and accessing pid like this is racy. Why not save the "struct
> pid" after getting the reference? I am still going over the usage,
> maybe storing mm_struct would be an even better choice.
> 
> > +   struct list_head regions_list;
> > +   struct list_head list;
> > +};
> > +
[...]
> > +
> > +#define damon_get_task_struct(t) \
> > +   (get_pid_task(find_vpid(t->pid), PIDTYPE_PID))
> 
> You need at least rcu lock around find_vpid(). Also you need to be
> careful about the context. If you accept my previous suggestion then
> you just need to do this in the process context which is registering
> the pid (no need to worry about the pid namespace).
> 
> I am wondering if there should be an interface to register processes
> with DAMON using pidfd instead of integer pid.

Good points!  I will use pidfd for this purpose, instead.

BTW, 'struct damon_task' was introduced while DAMON supports only virtual
address spaces and recently extended to support physical memory address
monitoring case by defining an exceptional pid (-1) for such case.  I think it
doesn't smoothly fit with the design.

Therefore, I would like to change it with more general named struct, e.g.,

struct damon_target {
void *id;
struct list_head regions_list;
struct list_head list;
};

The 'id' field will be able to store or point pid_t, struct mm_struct, struct
pid, or anything relevant, depending on the target address space.

Only one part of the address space independent logics of DAMON, namely
'kdamon_need_stop()', uses '->pid' of the 'struct damon_task'.  It will be
introduced by the next patch ("mm/damon: Implement region based sampling").
Therefore, the conversion will be easy.  For the part, I could add another
callback, e.g.,

struct damon_ctx {
[...]
bool (*is_target_valid)(struct damon_target *t);
};

And let the address space specific primitives to implement this.

Then, damon_get_task_struct() and damon_get_mm() will be introduced by the
sixth patch ("mm/damon: Implement callbacks for the virtual memory address
spaces") as a part of the virtual address space specific primitives
implementation.

I gonna make the change in the next spin.  If you have some opinions on this,
please let me know.


Thanks,
SeongJae 

Re: [v2 1/4] coccinelle: api: extend memdup_user transformation with GFP_USER

2020-07-18 Thread Julia Lawall



On Sat, 18 Jul 2020, Denis Efremov wrote:

> Hi,
>
> On 7/18/20 9:45 AM, Julia Lawall wrote:
> > This on is indeed a problem.  I think it was not detected in testing,
> > because in the current kernel the rule never applies.  But Denis, in
> >
> > -  to = \(kmalloc\|kzalloc\)
> > (size,\(GFP_KERNEL\|GFP_USER\|
> >   \(GFP_KERNEL\|GFP_USER\)|__GFP_NOWARN\));
> >
> > you do indeed need to put - in front of the second and third lines as
> > well.
>
> Thanks, Markus, Julia. I will send v3. Julia, is it ok with you, if I will
> drop the last patch with "selfcheck" this time?

That would be perfect, thanks.

julia


[PATCH] jbd2: fix incorrect code style

2020-07-18 Thread Xianting Tian
Remove unnecessary blank.

Signed-off-by: Xianting Tian 
---
 fs/jbd2/journal.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index e494443..5eccf8c 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1285,7 +1285,7 @@ journal_t *jbd2_journal_init_inode(struct inode *inode)
  * superblock as being NULL to prevent the journal destroy from writing
  * back a bogus superblock.
  */
-static void journal_fail_superblock (journal_t *journal)
+static void journal_fail_superblock(journal_t *journal)
 {
struct buffer_head *bh = journal->j_sb_buffer;
brelse(bh);
@@ -1815,7 +1815,7 @@ int jbd2_journal_destroy(journal_t *journal)
 
 
 /**
- *int jbd2_journal_check_used_features () - Check if features specified are 
used.
+ *int jbd2_journal_check_used_features() - Check if features specified are 
used.
  * @journal: Journal to check.
  * @compat: bitmask of compatible features
  * @ro: bitmask of features that force read-only mount
@@ -1825,7 +1825,7 @@ int jbd2_journal_destroy(journal_t *journal)
  * features.  Return true (non-zero) if it does.
  **/
 
-int jbd2_journal_check_used_features (journal_t *journal, unsigned long compat,
+int jbd2_journal_check_used_features(journal_t *journal, unsigned long compat,
 unsigned long ro, unsigned long incompat)
 {
journal_superblock_t *sb;
@@ -1860,7 +1860,7 @@ int jbd2_journal_check_used_features (journal_t *journal, 
unsigned long compat,
  * all of a given set of features on this journal.  Return true
  * (non-zero) if it can. */
 
-int jbd2_journal_check_available_features (journal_t *journal, unsigned long 
compat,
+int jbd2_journal_check_available_features(journal_t *journal, unsigned long 
compat,
  unsigned long ro, unsigned long incompat)
 {
if (!compat && !ro && !incompat)
@@ -1882,7 +1882,7 @@ int jbd2_journal_check_available_features (journal_t 
*journal, unsigned long com
 }
 
 /**
- * int jbd2_journal_set_features () - Mark a given journal feature in the 
superblock
+ * int jbd2_journal_set_features() - Mark a given journal feature in the 
superblock
  * @journal: Journal to act on.
  * @compat: bitmask of compatible features
  * @ro: bitmask of features that force read-only mount
@@ -1893,7 +1893,7 @@ int jbd2_journal_check_available_features (journal_t 
*journal, unsigned long com
  *
  */
 
-int jbd2_journal_set_features (journal_t *journal, unsigned long compat,
+int jbd2_journal_set_features(journal_t *journal, unsigned long compat,
  unsigned long ro, unsigned long incompat)
 {
 #define INCOMPAT_FEATURE_ON(f) \
-- 
1.8.3.1



[PATCH] staging: media: atomisp: Replace depracated MSI API.

2020-07-18 Thread Suraj Upadhyay
Replace depracated pci_enable_msi with pci_alloc_irq_vectors.
And as a result modify how the returned value is handled.

Signed-off-by: Suraj Upadhyay 
---
 drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c 
b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
index d36809a0182c..b824c6f78a9c 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c
@@ -1735,8 +1735,8 @@ static int atomisp_pci_probe(struct pci_dev *dev,
pci_set_master(dev);
pci_set_drvdata(dev, isp);
 
-   err = pci_enable_msi(dev);
-   if (err) {
+   err = pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_MSI);
+   if (err < 0) {
dev_err(>dev, "Failed to enable msi (%d)\n", err);
goto enable_msi_fail;
}
-- 
2.17.1



signature.asc
Description: PGP signature


Re: [PATCH] dmaengine: linux/dmaengine.h: drop duplicated word in a comment

2020-07-18 Thread Vinod Koul
On 17-07-20, 19:51, Randy Dunlap wrote:
> From: Randy Dunlap 
> 
> Drop the doubled word "has" in a comment.

Applied, thanks

-- 
~Vinod


[PATCH] scsi: smartpqi: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 Documentation/scsi/smartpqi.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/scsi/smartpqi.rst b/Documentation/scsi/smartpqi.rst
index a7de27352c6f..38dafc70b4cd 100644
--- a/Documentation/scsi/smartpqi.rst
+++ b/Documentation/scsi/smartpqi.rst
@@ -5,7 +5,7 @@ SMARTPQI - Microsemi Smart PQI Driver
 =
 
 This file describes the smartpqi SCSI driver for Microsemi
-(http://www.microsemi.com) PQI controllers. The smartpqi driver
+(https://www.microsemi.com) PQI controllers. The smartpqi driver
 is the next generation SCSI driver for Microsemi Corp. The smartpqi
 driver is the first SCSI driver to implement the PQI queuing model.
 
@@ -19,8 +19,8 @@ when configuring the kernel.
 
 For more information on the PQI Queuing Interface, please see:
 
-- http://www.t10.org/drafts.htm
-- http://www.t10.org/members/w_pqi2.htm
+- https://www.t10.org/drafts.htm
+- https://www.t10.org/members/w_pqi2.htm
 
 Supported devices
 =
-- 
2.27.0



Re: [PATCH 2/2] dt-bindings: net: dsa: qca8k: Add PORT0_PAD_CTRL properties

2020-07-18 Thread Russell King - ARM Linux admin
On Fri, Jul 17, 2020 at 10:44:19PM +0200, John Crispin wrote:
> in regards to the sgmii clk skew. I never understood the electrics fully I
> am afraid, but without the patch it simply does not work. my eletcric foo is
> unfortunately is not sufficient to understand the "whys" I am afraid.

Do you happen to know what frequency the clock is?  Is it 1.25GHz or
625MHz?  It sounds like it may be 1.25GHz if the edge is important.

If the clock is 1.25GHz, the "why" is because of hazards (it has
nothing to do with delays in RGMII being propagated to SGMII).

Quite simply, a flip-flop suffers from metastability if the clock and
data inputs change at about the same time.  Amongst the parametrics of
flip-flops will be a data setup time, and a data hold time, referenced
to the clock signal.

If the data changes within the setup and hold times of the clock
changing, then the output of the flip-flop is unpredictable - it can
latch a logic 1 or a logic 0, or oscillate between the two until
settling on one state.

So, if data is clocked out on the rising edge of a clock signal, and
clocked in on the rising edge of a clock signal - and the data and
clock edges arrive within the setup and hold times at the flip-flop
that is clocking the data in, there is a metastability hazard, and
the data bit that is latched is unpredictable.

One way to solve this is to clock data out on one edge, and clock data
in on the opposite edge - this is used on buses such as SPI.  Other
buses such as I2C define minimum separation between transitions between
the SDA and SCL signals.

These solutions don't work with RGMII - the RGMII TXC clocks data on
both edges.  The only solution there is to ensure a delay is introduced
between the data and clock changes seen at the receiver - which can be
done by introducing delays at the transmitter or at the receiver, or by
serpentine routing of the traces to induce delays to separate the clock
and data transitions sufficiently to avoid metastability.

If the clock is 625MHz (as with some Marvell devices for SGMII) then
both clock edges are used, and both edges are used just like RGMII.
Therefore, the same considerations as RGMII apply there to ensure that
the data setup and hold times are not violated.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!


[PATCH] staging: rts5208: rtsx: Replace depracated MSI API

2020-07-18 Thread Suraj Upadhyay
Replace depracated pci_enable_msi with pci_alloc_irq_vectors.

Signed-off-by: Suraj Upadhyay 
---
 drivers/staging/rts5208/rtsx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index e28e162d004e..adc80e766412 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -310,7 +310,7 @@ static int __maybe_unused rtsx_resume(struct device *dev_d)
pci_set_master(pci);
 
if (chip->msi_en) {
-   if (pci_enable_msi(pci) < 0)
+   if (pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_MSI) < 0)
chip->msi_en = 0;
}
 
@@ -881,7 +881,7 @@ static int rtsx_probe(struct pci_dev *pci,
dev_info(>dev, "pci->irq = %d\n", pci->irq);
 
if (dev->chip->msi_en) {
-   if (pci_enable_msi(pci) < 0)
+   if (pci_alloc_irq_vectors(dev, 1, 1, PCI_IRQ_MSI) < 0)
dev->chip->msi_en = 0;
}
 
-- 
2.17.1



signature.asc
Description: PGP signature


Re: [PATCH 4/4] staging: rtl8188eu: include: placed constant on the right side of the test in comparisons

2020-07-18 Thread Joe Perches
On Sat, 2020-07-18 at 05:18 -0400, B K Karthik wrote:
> placed constant on the right side of the test
> to fix warnings issued by checkpatch
[]
> diff --git a/drivers/staging/rtl8188eu/include/wifi.h 
> b/drivers/staging/rtl8188eu/include/wifi.h
[]
> @@ -326,7 +326,7 @@ static inline unsigned char *get_hdr_bssid(unsigned char 
> *pframe)
>  
>  static inline int IsFrameTypeCtrl(unsigned char *pframe)
>  {
> - if (WIFI_CTRL_TYPE == GetFrameType(pframe))
> + if (GetFrameType(pframe) == WIFI_CTRL_TYPE)
>   return true;
>   else
>   return false;

Always try to improve code instead of merely shutting
up checkpatch warnings.

This function should likely be written:

static inline bool IsFrameTypeCtrl(unsigned char *pframe)
{
return GetFrameType(pframe) == WIFI_CTRL_TYPE;
}

and given it's used only once, it might be expanded
in that place and removed altogether.

Something like:

(and the memcmp below could be ether_addr_equal instead
 but I'm too lazy to find out if the addresses are both
 guaranteed to be __aligned(2) which is likely)

---
 drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c | 8 +---
 drivers/staging/rtl8188eu/include/wifi.h| 7 ---
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c 
b/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c
index 7d0135fde795..a2994f9ecbde 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c
@@ -144,10 +144,12 @@ void update_recvframe_phyinfo_88e(struct recv_frame 
*precvframe,
 
wlanhdr = precvframe->pkt->data;
 
-   pkt_info.bPacketMatchBSSID = ((!IsFrameTypeCtrl(wlanhdr)) &&
-   !pattrib->icv_err && !pattrib->crc_err &&
+   pkt_info.bPacketMatchBSSID =
+   GetFrameType(wlanhdr) != WIFI_CTRL_TYPE &&
+   !pattrib->icv_err &&
+   !pattrib->crc_err &&
!memcmp(get_hdr_bssid(wlanhdr),
-get_bssid(>mlmepriv), ETH_ALEN));
+   get_bssid(>mlmepriv), ETH_ALEN);
 
pkt_info.bPacketToSelf = pkt_info.bPacketMatchBSSID &&
 (!memcmp(get_da(wlanhdr),
diff --git a/drivers/staging/rtl8188eu/include/wifi.h 
b/drivers/staging/rtl8188eu/include/wifi.h
index 791f287a546d..3998d5633860 100644
--- a/drivers/staging/rtl8188eu/include/wifi.h
+++ b/drivers/staging/rtl8188eu/include/wifi.h
@@ -324,13 +324,6 @@ static inline unsigned char *get_hdr_bssid(unsigned char 
*pframe)
return sa;
 }
 
-static inline int IsFrameTypeCtrl(unsigned char *pframe)
-{
-   if (WIFI_CTRL_TYPE == GetFrameType(pframe))
-   return true;
-   else
-   return false;
-}
 /*-
Below is for the security related definition
 
--*/






Re: [PATCH v6 2/2] clocksource: Ingenic: Add support for the Ingenic X1000 OST.

2020-07-18 Thread Paul Cercueil

Hi Daniel,

Le ven. 17 juil. 2020 à 10:02, Daniel Lezcano 
 a écrit :

On 17/07/2020 08:13, Zhou Yanjie wrote:

 Hi Daniel,

 在 2020/7/17 下午12:20, Daniel Lezcano 写道:

 On 10/07/2020 19:02, 周琰杰 (Zhou Yanjie) wrote:
 X1000 and SoCs after X1000 (such as X1500 and X1830) had a 
separate

 OST, it no longer belongs to TCU. This driver will register both a
 clocksource and a sched_clock to the system.

 Tested-by: 周正 (Zhou Zheng) 
 Co-developed-by: 漆鹏振 (Qi Pengzhen) 
 Signed-off-by: 漆鹏振 (Qi Pengzhen) 
 Signed-off-by: 周琰杰 (Zhou Yanjie) 
 Reviewed-by: Paul Cercueil 
 ---

 Notes:
  v1->v2:
  Fix compile warnings.
  Reported-by: kernel test robot 
   v2->v3:
  No change.
   v3->v4:
  1.Rename "ost" to "sysost"
  1.Remove unrelated changes.
  2.Remove ost_clock_parent enum.
  3.Remove ost->percpu_timer_channel/ost->global_timer_channel.
  4.Set up independent .recalc_rate/.set_rate for percpu/global
 timer.
  5.No longer call functions in variable declarations.
   v4->v5:
  Use "of_io_request_and_map()" instead "of_iomap()".
  Suggested-by: Paul Cercueil 
   v5->v6:
  No change.

   drivers/clocksource/Kconfig  |  11 +
   drivers/clocksource/Makefile |   1 +
   drivers/clocksource/ingenic-sysost.c | 539
 +++
   3 files changed, 551 insertions(+)
   create mode 100644 drivers/clocksource/ingenic-sysost.c

 diff --git a/drivers/clocksource/Kconfig 
b/drivers/clocksource/Kconfig

 index 91418381fcd4..1bca8b8fb30f 100644
 --- a/drivers/clocksource/Kconfig
 +++ b/drivers/clocksource/Kconfig
 @@ -696,6 +696,17 @@ config INGENIC_TIMER
   help
 Support for the timer/counter unit of the Ingenic JZ SoCs.
   +config INGENIC_SYSOST
 +bool "Clocksource/timer using the SYSOST in Ingenic X SoCs"
 We usually use silent options and let the platform's Kconfig 
enable it.

 We show up the option only when COMPILE_TEST is enabled.

 Is there a reason to do it differently?



 Do you mean

 bool "Clocksource/timer using the SYSOST in Ingenic X SoCs"

 or

 default MACH_INGENIC ?


Both, no default here.

eg.

bool "Clocksource/timer using the SYSOST in Ingenic X SoCs" if 
COMPILE_TEST


and

in arch/mips/Kconfig in the config MACH_INGENIC section :

...
select INGENIC_SYSOST
...


Disagreed. That's not how we do things on MIPS. Selecting MACH_INGENIC 
means "this kernel will support Ingenic SoCs", but not that it will 
only support these. Hence the depends on MIPS / default MACH_INGENIC.


As for the select INGENIC_SYSOST, this driver only applies to a few 
SoCs, I certainly don't want it to be force-enabled. I don't even wait 
it to be force-enabled on X1000, since it is optional there too.


Cheers,
-Paul




 This driver has some origins from "INGENIC_TIMER" driver and
 "INGENIC_OST" driver.
 Early Ingenic processors used TCU (timer/counter unit, has 6 or 8
 generic timer channels) to provide clocksource and clockevent (both 
with

 only 16bit precision). This part of the processor can only use
 "INGENIC_TIMER" driver.

 Later processors provide an independent 32bit or 64bit timer channel
 (still under TCU, known as ost channel, this channel can not 
generate

 interrupt) to provid higher precision clocksource. The "INGENIC_OST"
 driver is for this channel. These processors can use "INGENIC_TIMER"
 driver, but using "INGENIC_OST" driver to provide higher precision
 clocksource would be a better choice (clockevent still needs to be
 provided by generic timer channel of TCU, and still 16bit 
precision).


 And the recent processors provide a SYSOST components, it is 
independent
 from TCU, including a 64bit timer channel for clocksource and a 
32bit

 timer channel for clockevent. Although these processors can also use
 "INGENIC_TIMER" driver, but the better choice is completely 
independent
 use of "INGENIC_SYSOST" driver to provide higher precision 
clocksource

 and clockevent.


Ok, the rating should do the job then.

Thanks for the explanation.

 You may have already noticed that this independent SYSOST component 
is

 like an upgraded and streamlined TCU, which only retains one generic
 timer channel that can generate interrupts, upgrade it from 16bit to
 32bit, and then retain the 64bit ost channel. so the driver code and
 Kconfig code of this patch is largely referenced
 "INGENIC_TIMER" driver and "INGENIC_OST" driver.

 Thanks and best regards!


 +default MACH_INGENIC
 +depends on MIPS || COMPILE_TEST
 +depends on COMMON_CLK
 +select MFD_SYSCON
 +select TIMER_OF
 +select IRQ_DOMAIN
 +help
 +  Support for the SYSOST of the Ingenic X Series SoCs.
 +

 [ ... ]





--
 Linaro.org │ Open source software for ARM 
SoCs


Follow Linaro:   Facebook |
 Twitter |
 Blog





Re: [v2 1/4] coccinelle: api: extend memdup_user transformation with GFP_USER

2020-07-18 Thread Denis Efremov
Hi,

On 7/18/20 9:45 AM, Julia Lawall wrote:
> This on is indeed a problem.  I think it was not detected in testing,
> because in the current kernel the rule never applies.  But Denis, in
> 
> -  to = \(kmalloc\|kzalloc\)
> (size,\(GFP_KERNEL\|GFP_USER\|
>   \(GFP_KERNEL\|GFP_USER\)|__GFP_NOWARN\));
> 
> you do indeed need to put - in front of the second and third lines as
> well.

Thanks, Markus, Julia. I will send v3. Julia, is it ok with you, if I will
drop the last patch with "selfcheck" this time?

Regards,
Denis


Re: 5.8-rc*: kernel BUG at kernel/signal.c:1917

2020-07-18 Thread Jiri Slaby
On 17. 07. 20, 13:12, Christian Brauner wrote:
> On Fri, Jul 17, 2020 at 01:04:38PM +0200, Jiri Slaby wrote:
>> On 17. 07. 20, 12:45, Jiri Slaby wrote:
>>> Hi,
>>>
>>> the strace testsuite triggers this on 5.8-rc4 and -rc5 both on x86_64
>>> and i586:
>>
>> make check needs -jsomething, running is sequentially (-j1) doesn't
>> trigger it. After the error, I cannot run anything. Like ps to find out
>> what test caused the crash...
>>
>> 5.7 was fine.
> 
> Can you try and reproduce with
> 
> commit e91b48162332480f5840902268108bb7fb7a44c7
> Author: Oleg Nesterov 
> Date:   Tue Jun 30 17:32:54 2020 +0200
> 
> task_work: teach task_work_add() to do signal_wake_up()
> 
> reverted, please?

I reverted these 3:
+This reverts commit b7db41c9e03b5189bc94993bd50e4506ac9e34c1.
+This reverts commit ce593a6c480a22acba08795be313c0c6d49dd35d.
+This reverts commit e91b48162332480f5840902268108bb7fb7a44c7.

But it still crashes.

thanks,
-- 
js


[GIT PULL] Please pull powerpc/linux.git powerpc-5.8-7 tag

2020-07-18 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hi Linus,

Please pull some more powerpc fixes for 5.8:

The following changes since commit 4557ac6b344b8cdf948ff8b007e8e1de34832f2e:

  powerpc/64s/exception: Fix 0x1500 interrupt handler crash (2020-07-08 
20:41:06 +1000)

are available in the git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git 
tags/powerpc-5.8-7

for you to fetch changes up to f0479c4bcbd92d1a457d4a43bcab79f29d11334a:

  selftests/powerpc: Use proper error code to check fault address (2020-07-15 
23:10:17 +1000)

- --
powerpc fixes for 5.8 #7

A fix to the VAS code we merged this cycle, to report the proper error code to
userspace for address translation failures. And a selftest update to match.

Another fix for our pkey handling of PROT_EXEC mappings.

A fix for a crash when booting a "secure VM" under an ultravisor with certain
numbers of CPUs.

Thanks to:
  Aneesh Kumar K.V, Haren Myneni, Laurent Dufour, Sandipan Das, Satheesh
  Rajendran, Thiago Jung Bauermann.

- --
Aneesh Kumar K.V (1):
  powerpc/book3s64/pkeys: Fix pkey_access_permitted() for execute disable 
pkey

Haren Myneni (2):
  powerpc/vas: Report proper error code for address translation failure
  selftests/powerpc: Use proper error code to check fault address

Satheesh Rajendran (1):
  powerpc/pseries/svm: Fix incorrect check for shared_lppaca_size


 Documentation/powerpc/vas-api.rst|  2 +-
 arch/powerpc/include/asm/icswx.h |  2 ++
 arch/powerpc/kernel/paca.c   |  2 +-
 arch/powerpc/mm/book3s64/pkeys.c | 12 +++-
 arch/powerpc/platforms/powernv/vas-fault.c   |  2 +-
 tools/testing/selftests/powerpc/nx-gzip/gunz_test.c  |  4 ++--
 tools/testing/selftests/powerpc/nx-gzip/gzfht_test.c |  4 ++--
 7 files changed, 16 insertions(+), 12 deletions(-)
-BEGIN PGP SIGNATURE-

iQIzBAEBCAAdFiEEJFGtCPCthwEv2Y/bUevqPMjhpYAFAl8S8nIACgkQUevqPMjh
pYCxFQ//X8A9GN94Yj4AroV4WR1nhcYOGFJw++FBjWWIE/3HnUmYKKP0aZ2Vd9DW
bjkJvhWLThV6P7lrDG2jOAp4g9ByDi6Syk0VbUxO0Vr2XMFqExoYe3hPSQysbvwM
ajMZWsvyI3wndXgS0HL3/zSkio0DyMyDVqGAPd7G3V+U/B8OM2WvBkoEtoWlcu0t
sFoqGPz02e9FX1jJsuVpBopWnaK2mtUX9CbPxeMQ9yxq7MXnkM/ynKIKdFHj5G7Q
9s2f7Pe6hF+SMu+KqZBvtQ0U8u/YNxTZR305l6ymq1aOERSy51o+ft9vMCD8xrPN
FCQpKqTk8LP0xYLLqZMEHLloYYBQ7R4eSmvleRNMKctodOca1ACMWGkT3otsGPUN
li3HJd9ktaXWK9l9Pf2VZGJF2Ge9tudjSrPJjhZlnZIp1S9JvjqJKtlSaMMsVNrD
doC9TAym2GLjaOTZ4qTiIEnO5ds2VvkRDdgsklpAyNJr8xrT8VYR2teInLro8sD9
m0z7JYGXQAL0Tm5YcuzrVqFllwtFsaUtcLkxW9tfFijmVfdGL24pxvIm6M8X5Kko
2eoa+M7DJzn+oWOFlVdzzq4zRxbUIHkzkvF1aROt7a/8G2bJb0J4ruwXJBnTsFi7
uSuPDNc8dpYKh9WikiIioUhV4XEDdllWMqaEOA19muny/ui5iVM=
=wk5N
-END PGP SIGNATURE-


Re: [PATCH 2/2] dt-bindings: net: dsa: qca8k: Add PORT0_PAD_CTRL properties

2020-07-18 Thread Vladimir Oltean
On Fri, Jul 17, 2020 at 08:26:02PM +0100, Matthew Hagan wrote:
> 
> 
> On 16/07/2020 23:32, Andrew Lunn wrote:
> > On Thu, Jul 16, 2020 at 03:09:25PM -0700, Jakub Kicinski wrote:
> >> On Mon, 13 Jul 2020 21:50:26 +0100 Matthew Hagan wrote:
> >>> Add names and decriptions of additional PORT0_PAD_CTRL properties.
> >>>
> >>> Signed-off-by: Matthew Hagan 
> >>> ---
> >>>  Documentation/devicetree/bindings/net/dsa/qca8k.txt | 8 
> >>>  1 file changed, 8 insertions(+)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/net/dsa/qca8k.txt 
> >>> b/Documentation/devicetree/bindings/net/dsa/qca8k.txt
> >>> index ccbc6d89325d..3d34c4f2e891 100644
> >>> --- a/Documentation/devicetree/bindings/net/dsa/qca8k.txt
> >>> +++ b/Documentation/devicetree/bindings/net/dsa/qca8k.txt
> >>> @@ -13,6 +13,14 @@ Optional properties:
> >>>  
> >>>  - reset-gpios: GPIO to be used to reset the whole device
> >>>  
> >>> +Optional MAC configuration properties:
> >>> +
> >>> +- qca,exchange-mac0-mac6:If present, internally swaps MAC0 and 
> >>> MAC6.
> >>
> >> Perhaps we can say a little more here?
> >>
> >>> +- qca,sgmii-rxclk-falling-edge:  If present, sets receive clock phase to
> >>> + falling edge.
> >>> +- qca,sgmii-txclk-falling-edge:  If present, sets transmit clock phase to
> >>> + falling edge.
> >>
> >> These are not something that other vendors may implement and therefore
> >> something we may want to make generic? Andrew?
> > 
> > I've never seen any other vendor implement this. Which to me makes me
> > think this is a vendor extension, to Ciscos vendor extension of
> > 1000BaseX.
> > 
> > Matthew, do you have a real use cases of these? I don't see a DT patch
> > making use of them. And if you do, what is the PHY on the other end
> > which also allows you to invert the clocks?
> > 
> The use case I am working on is the Cisco Meraki MX65 which requires bit
> 18 set (qca,sgmii-txclk-falling-edge). On the other side is a BCM58625
> SRAB with ports 4 and 5 in SGMII mode. There is no special polarity
> configuration set on this side though I do have very limited info on
> what is available. The settings I have replicate the vendor
> configuration extracted from the device.
> 
> The qca,sgmii-rxclk-falling-edge option (bit 19) is commonly used
> according to the device trees found in the OpenWrt, which is still using
> the ar8216 driver. With a count through the ar8327-initvals I see bit 19
> set on 18 of 22 devices using SGMII on MAC0.
> >Andrew
> > 
> 
> Matthew

Let's say I'm a user. When would I need to set
qca,sgmii-txclk-falling-edge and/or qca,sgmii-rxclk-falling-edge, and
wwhen would I need not to?

Thanks,
-Vladimir


[PATCH -next] net: hsr: remove redundant null check

2020-07-18 Thread Wang Hai
Because kfree_skb already checked NULL skb parameter,
so the additional checks are unnecessary, just remove them.

Reported-by: Hulk Robot 
Signed-off-by: Wang Hai 
---
 net/hsr/hsr_forward.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
index ed13760463de..92c8ad75200b 100644
--- a/net/hsr/hsr_forward.c
+++ b/net/hsr/hsr_forward.c
@@ -367,10 +367,8 @@ void hsr_forward_skb(struct sk_buff *skb, struct hsr_port 
*port)
port->dev->stats.tx_bytes += skb->len;
}
 
-   if (frame.skb_hsr)
-   kfree_skb(frame.skb_hsr);
-   if (frame.skb_std)
-   kfree_skb(frame.skb_std);
+   kfree_skb(frame.skb_hsr);
+   kfree_skb(frame.skb_std);
return;
 
 out_drop:
-- 
2.17.1



Re: [PATCH v3 0/3] Off-load TLB invalidations to host for !GTSE

2020-07-18 Thread Michael Ellerman
Bharata B Rao  writes:
> On Fri, Jul 17, 2020 at 12:44:00PM +1000, Nicholas Piggin wrote:
>> Excerpts from Nicholas Piggin's message of July 17, 2020 12:08 pm:
>> > Excerpts from Qian Cai's message of July 17, 2020 3:27 am:
>> >> On Fri, Jul 03, 2020 at 11:06:05AM +0530, Bharata B Rao wrote:
>> >>> Hypervisor may choose not to enable Guest Translation Shootdown Enable
>> >>> (GTSE) option for the guest. When GTSE isn't ON, the guest OS isn't
>> >>> permitted to use instructions like tblie and tlbsync directly, but is
>> >>> expected to make hypervisor calls to get the TLB flushed.
>> >>> 
>> >>> This series enables the TLB flush routines in the radix code to
>> >>> off-load TLB flushing to hypervisor via the newly proposed hcall
>> >>> H_RPT_INVALIDATE. 
>> >>> 
>> >>> To easily check the availability of GTSE, it is made an MMU feature.
>> >>> The OV5 handling and H_REGISTER_PROC_TBL hcall are changed to
>> >>> handle GTSE as an optionally available feature and to not assume GTSE
>> >>> when radix support is available.
>> >>> 
>> >>> The actual hcall implementation for KVM isn't included in this
>> >>> patchset and will be posted separately.
>> >>> 
>> >>> Changes in v3
>> >>> =
>> >>> - Fixed a bug in the hcall wrapper code where we were missing setting
>> >>>   H_RPTI_TYPE_NESTED while retrying the failed flush request with
>> >>>   a full flush for the nested case.
>> >>> - s/psize_to_h_rpti/psize_to_rpti_pgsize
>> >>> 
>> >>> v2: 
>> >>> https://lore.kernel.org/linuxppc-dev/20200626131000.5207-1-bhar...@linux.ibm.com/T/#t
>> >>> 
>> >>> Bharata B Rao (2):
>> >>>   powerpc/mm: Enable radix GTSE only if supported.
>> >>>   powerpc/pseries: H_REGISTER_PROC_TBL should ask for GTSE only if
>> >>> enabled
>> >>> 
>> >>> Nicholas Piggin (1):
>> >>>   powerpc/mm/book3s64/radix: Off-load TLB invalidations to host when
>> >>> !GTSE
>> >> 
>> >> Reverting the whole series fixed random memory corruptions during boot on
>> >> POWER9 PowerNV systems below.
>> > 
>> > If I s/mmu_has_feature(MMU_FTR_GTSE)/(1)/g in radix_tlb.c, then the .o
>> > disasm is the same as reverting my patch.
>> > 
>> > Feature bits not being set right? PowerNV should be pretty simple, seems
>> > to do the same as FTR_TYPE_RADIX.
>> 
>> Might need this fix
>> 
>> ---
>> 
>> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
>> index 9cc49f265c86..54c9bcea9d4e 100644
>> --- a/arch/powerpc/kernel/prom.c
>> +++ b/arch/powerpc/kernel/prom.c
>> @@ -163,7 +163,7 @@ static struct ibm_pa_feature {
>>  { .pabyte = 0,  .pabit = 6, .cpu_features  = CPU_FTR_NOEXECUTE },
>>  { .pabyte = 1,  .pabit = 2, .mmu_features  = MMU_FTR_CI_LARGE_PAGE },
>>  #ifdef CONFIG_PPC_RADIX_MMU
>> -{ .pabyte = 40, .pabit = 0, .mmu_features  = MMU_FTR_TYPE_RADIX },
>> +{ .pabyte = 40, .pabit = 0, .mmu_features  = (MMU_FTR_TYPE_RADIX | 
>> MMU_FTR_GTSE) },
>>  #endif
>>  { .pabyte = 1,  .pabit = 1, .invert = 1, .cpu_features = 
>> CPU_FTR_NODSISRALIGN },
>>  { .pabyte = 5,  .pabit = 0, .cpu_features  = CPU_FTR_REAL_LE,
>
> Michael - Let me know if this should be folded into 1/3 and the complete
> series resent.

No it's already merged.

Please send a proper patch with a Fixes: tag and a change log that
explains the details.

cheers


[PATCH] tty: serial: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 drivers/tty/serial/8250/Kconfig | 4 ++--
 drivers/tty/serial/jsm/jsm_driver.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index d2ae033aea40..603137da4736 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -222,7 +222,7 @@ config SERIAL_8250_MANY_PORTS
  Say Y here if you have dumb serial boards other than the four
  standard COM 1/2/3/4 ports. This may happen if you have an AST
  FourPort, Accent Async, Boca (read the Boca mini-HOWTO, available
- from ), or other custom
+ from ), or other custom
  serial port hardware which acts similar to standard serial port
  hardware. If you only use the standard COM 1/2/3/4 ports, you can
  say N here to save some memory. You can also say Y if you have an
@@ -266,7 +266,7 @@ config SERIAL_8250_BOCA
depends on SERIAL_8250 != n && ISA && SERIAL_8250_MANY_PORTS
help
  Say Y here if you have a Boca serial board.  Please read the Boca
- mini-HOWTO, available from 
+ mini-HOWTO, available from 
 
  To compile this driver as a module, choose M here: the module
  will be called 8250_boca.
diff --git a/drivers/tty/serial/jsm/jsm_driver.c 
b/drivers/tty/serial/jsm/jsm_driver.c
index 592e51d8944e..cd30da0ef083 100644
--- a/drivers/tty/serial/jsm/jsm_driver.c
+++ b/drivers/tty/serial/jsm/jsm_driver.c
@@ -16,7 +16,7 @@
 
 #include "jsm.h"
 
-MODULE_AUTHOR("Digi International, http://www.digi.com;);
+MODULE_AUTHOR("Digi International, https://www.digi.com;);
 MODULE_DESCRIPTION("Driver for the Digi International Neo and Classic PCI 
based product line");
 MODULE_LICENSE("GPL");
 MODULE_SUPPORTED_DEVICE("jsm");
-- 
2.27.0



Re: [PATCH 3/4] staging: rtl8188eu: include: enclosed macros in do-while loops

2020-07-18 Thread kernel test robot
Hi K,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]

url:
https://github.com/0day-ci/linux/commits/B-K-Karthik/staging-rtl8188eu-include-fixed-multiple-blank-space-coding-style-issues/20200718-172103
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
9d5d041eebe3dcf7591ff7004896c329eb841ca6
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All error/warnings (new ones prefixed by >>):

   In file included from arch/m68k/include/asm/io_mm.h:25,
from arch/m68k/include/asm/io.h:8,
from include/linux/scatterlist.h:9,
from include/linux/dma-mapping.h:11,
from include/linux/skbuff.h:31,
from include/linux/if_ether.h:19,
from include/uapi/linux/ethtool.h:19,
from include/linux/ethtool.h:18,
from include/linux/netdevice.h:37,
from drivers/staging/rtl8188eu/include/osdep_service.h:23,
from drivers/staging/rtl8188eu/core/rtw_efuse.c:9:
   arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsb':
   arch/m68k/include/asm/raw_io.h:83:7: warning: variable '__w' set but not 
used [-Wunused-but-set-variable]
  83 |  ({u8 __w, __v = (b);  u32 _addr = ((u32) (addr)); \
 |   ^~~
   arch/m68k/include/asm/raw_io.h:430:3: note: in expansion of macro 'rom_out_8'
 430 |   rom_out_8(port, *buf++);
 |   ^
   arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw':
   arch/m68k/include/asm/raw_io.h:86:8: warning: variable '__w' set but not 
used [-Wunused-but-set-variable]
  86 |  ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
 |^~~
   arch/m68k/include/asm/raw_io.h:448:3: note: in expansion of macro 
'rom_out_be16'
 448 |   rom_out_be16(port, *buf++);
 |   ^~~~
   arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw_swapw':
   arch/m68k/include/asm/raw_io.h:90:8: warning: variable '__w' set but not 
used [-Wunused-but-set-variable]
  90 |  ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
 |^~~
   arch/m68k/include/asm/raw_io.h:466:3: note: in expansion of macro 
'rom_out_le16'
 466 |   rom_out_le16(port, *buf++);
 |   ^~~~
   In file included from include/linux/kernel.h:11,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/spinlock.h:51,
from drivers/staging/rtl8188eu/include/osdep_service.h:16,
from drivers/staging/rtl8188eu/core/rtw_efuse.c:9:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of 
pointer with null pointer [-Wextra]
 169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void 
*)PAGE_OFFSET && (void *)(kaddr) < high_memory)
 | ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
  78 | # define unlikely(x) __builtin_expect(!!(x), 0)
 |  ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
 143 |  BUG_ON(!virt_addr_valid(buf));
 |  ^~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 
'virt_addr_valid'
 143 |  BUG_ON(!virt_addr_valid(buf));
 |  ^~~
   In file included from arch/m68k/include/asm/bug.h:32,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from drivers/staging/rtl8188eu/include/osdep_service.h:16,
from drivers/staging/rtl8188eu/core/rtw_efuse.c:9:
   include/linux/dma-mapping.h: In function 'dma_map_resource':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of 
pointer with null pointer [-Wextra]
 169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void 
*)PAGE_OFFSET && (void *)(kaddr) < high_memory)
 | ^~
   include/asm-generic/bug.h:144:27: note: in definition of ma

[PATCH -next] scsi: dpt_i2o: remove some not needed memset

2020-07-18 Thread Wang Hai
Fixes coccicheck warning:

./drivers/scsi/dpt_i2o.c:3070:11-29: WARNING:
 dma_alloc_coherent use in sys_tbl already zeroes out memory, so memset is not 
needed
./drivers/scsi/dpt_i2o.c:2780:10-28: WARNING:
 dma_alloc_coherent use in status already zeroes out memory, so memset is not 
needed
./drivers/scsi/dpt_i2o.c:2834:20-38: WARNING:
 dma_alloc_coherent use in pHba -> reply_pool already zeroes out memory, so 
memset is not needed
./drivers/scsi/dpt_i2o.c:1328:10-28: WARNING:
 dma_alloc_coherent use in status already zeroes out memory, so memset is not 
needed

Reported-by: Hulk Robot 
Signed-off-by: Wang Hai 
---
 drivers/scsi/dpt_i2o.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index 0497ef6a9453..f654ad8a3d69 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -1331,7 +1331,6 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
printk(KERN_ERR"IOP reset failed - no free memory.\n");
return -ENOMEM;
}
-   memset(status,0,4);
 
msg[0]=EIGHT_WORD_MSG_SIZE|SGL_OFFSET_0;
msg[1]=I2O_CMD_ADAPTER_RESET<<24|HOST_TID<<12|ADAPTER_TID;
@@ -2784,7 +2783,6 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
pHba->name);
return -ENOMEM;
}
-   memset(status, 0, 4);
 
writel(EIGHT_WORD_MSG_SIZE| SGL_OFFSET_6, [0]);
writel(I2O_CMD_OUTBOUND_INIT<<24 | HOST_TID<<12 | ADAPTER_TID, [1]);
@@ -2838,7 +2836,6 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
printk(KERN_ERR "%s: Could not allocate reply pool\n", 
pHba->name);
return -ENOMEM;
}
-   memset(pHba->reply_pool, 0 , pHba->reply_fifo_size * REPLY_FRAME_SIZE * 
4);
 
for(i = 0; i < pHba->reply_fifo_size; i++) {
writel(pHba->reply_pool_pa + (i * REPLY_FRAME_SIZE * 4),
@@ -3073,7 +3070,6 @@ static int adpt_i2o_build_sys_table(void)
printk(KERN_WARNING "SysTab Set failed. Out of memory.\n"); 
return -ENOMEM;
}
-   memset(sys_tbl, 0, sys_tbl_len);
 
sys_tbl->num_entries = hba_count;
sys_tbl->version = I2OVERSION;
-- 
2.17.1



[PATCH v3] hwmon: (drivetemp) Avoid SCT usage on Toshiba DT01ACA family drives

2020-07-18 Thread Maciej S. Szmigiero
It has been observed that Toshiba DT01ACA family drives have
WRITE FPDMA QUEUED command timeouts and sometimes just freeze until
power-cycled under heavy write loads when their temperature is getting
polled in SCT mode. The SMART mode seems to be fine, though.

Let's make sure we don't use SCT mode for these drives then.

While only the 3 TB model was actually caught exhibiting the problem let's
play safe here to avoid data corruption and extend the ban to the whole
family.

Fixes: 5b46903d8bf3 ("hwmon: Driver for disk and solid state drives with 
temperature sensors")
Cc: sta...@vger.kernel.org
Signed-off-by: Maciej S. Szmigiero 
---

Notes:
This behavior was observed on two different DT01ACA3 drives.

Usually, a series of queued WRITE FPDMA QUEUED commands just time out,
but sometimes the whole drive freezes. Merely disconnecting and
reconnecting SATA interface cable then does not unfreeze the drive.

One has to disconnect and reconnect the drive power connector for the
drive to be detected again (suggesting the drive firmware itself has
crashed).

This only happens when the drive temperature is polled very often (like
every second), so occasional SCT usage via smartmontools is probably
safe.

Changes from v1:
'SCT blacklist' -> 'SCT avoid models'

Changes from v2:
* Switch to prefix matching and use it to match the DT01ACAx family,

* Use "!" instead of "== 0",

* Add a comment about the contents of the "model" field.

 drivers/hwmon/drivetemp.c | 43 +++
 1 file changed, 43 insertions(+)

diff --git a/drivers/hwmon/drivetemp.c b/drivers/hwmon/drivetemp.c
index 0d4f3d97ffc6..72c760373957 100644
--- a/drivers/hwmon/drivetemp.c
+++ b/drivers/hwmon/drivetemp.c
@@ -285,6 +285,42 @@ static int drivetemp_get_scttemp(struct drivetemp_data 
*st, u32 attr, long *val)
return err;
 }
 
+static const char * const sct_avoid_models[] = {
+/*
+ * These drives will have WRITE FPDMA QUEUED command timeouts and sometimes 
just
+ * freeze until power-cycled under heavy write loads when their temperature is
+ * getting polled in SCT mode. The SMART mode seems to be fine, though.
+ *
+ * While only the 3 TB model (DT01ACA3) was actually caught exhibiting the
+ * problem let's play safe here to avoid data corruption and ban the whole
+ * DT01ACAx family.
+
+ * The models from this array are prefix-matched.
+ */
+   "TOSHIBA DT01ACA",
+};
+
+static bool drivetemp_sct_avoid(struct drivetemp_data *st)
+{
+   struct scsi_device *sdev = st->sdev;
+   unsigned int ctr;
+
+   if (!sdev->model)
+   return false;
+
+   /*
+* The "model" field contains just the raw SCSI INQUIRY response
+* "product identification" field, which has a width of 16 bytes.
+* This field is space-filled, but is NOT NULL-terminated.
+*/
+   for (ctr = 0; ctr < ARRAY_SIZE(sct_avoid_models); ctr++)
+   if (!strncmp(sdev->model, sct_avoid_models[ctr],
+strlen(sct_avoid_models[ctr])))
+   return true;
+
+   return false;
+}
+
 static int drivetemp_identify_sata(struct drivetemp_data *st)
 {
struct scsi_device *sdev = st->sdev;
@@ -326,6 +362,13 @@ static int drivetemp_identify_sata(struct drivetemp_data 
*st)
/* bail out if this is not a SATA device */
if (!is_ata || !is_sata)
return -ENODEV;
+
+   if (have_sct && drivetemp_sct_avoid(st)) {
+   dev_notice(>sdev_gendev,
+  "will avoid using SCT for temperature monitoring\n");
+   have_sct = false;
+   }
+
if (!have_sct)
goto skip_sct;
 


Re: 5.8-rc*: kernel BUG at kernel/signal.c:1917

2020-07-18 Thread Jiri Slaby
On 17. 07. 20, 14:40, Oleg Nesterov wrote:
> On 07/17, Oleg Nesterov wrote:
>>
>> On 07/17, Jiri Slaby wrote:
>>>
>>> On 17. 07. 20, 12:45, Jiri Slaby wrote:
 Hi,

 the strace testsuite triggers this on 5.8-rc4 and -rc5 both on x86_64
 and i586:
>>>
>>> make check needs -jsomething, running is sequentially (-j1) doesn't
>>> trigger it. After the error, I cannot run anything. Like ps to find out
>>> what test caused the crash...
>>
>> Strange... I'll try to reproduce but I can't do this till Monday.
>>
>> Meanwhile, could you try the patch below? It needs CONFIG_DEBUG_ATOMIC_SLEEP.
> 
> please see the updated patch below, lets check ptrace_unfreeze() too.

Sure, dmesg attached.

thanks,
-- 
js
[0.00] Linux version 5.8.0-rc5-100.g55927f9-default (geeko@buildhost) 
(gcc (SUSE Linux) 10.1.1 20200625 [revision 
c91e43e9363bd119a695d64505f96539fa451bf2], GNU ld (GNU Binutils; openSUSE 
Tumbleweed) 2.34.0.20200325-1) #1 SMP Sat Jul 18 06:57:08 UTC 2020 (55927f9)
[0.00] Command line: root=/dev/disk/by-id/virtio-0 rootfstype=ext4 
rootflags=noatime ext4.allow_unsupported=1 kpti=off pti=off spectre_v2=off 
panic=1 quiet no-kvmclock elevator=noop nmi_watchdog=0 rw 
rd.driver.pre=binfmt_misc console=ttyS0 init=/.build/build
[0.00] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point 
registers'
[0.00] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[0.00] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[0.00] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
[0.00] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, 
using 'standard' format.
[0.00] BIOS-provided physical RAM map:
[0.00] BIOS-e820: [mem 0x-0x0009fbff] usable
[0.00] BIOS-e820: [mem 0x0009fc00-0x0009] reserved
[0.00] BIOS-e820: [mem 0x000f-0x000f] reserved
[0.00] BIOS-e820: [mem 0x0010-0xbffd8fff] usable
[0.00] BIOS-e820: [mem 0xbffd9000-0xbfff] reserved
[0.00] BIOS-e820: [mem 0xfeffc000-0xfeff] reserved
[0.00] BIOS-e820: [mem 0xfffc-0x] reserved
[0.00] BIOS-e820: [mem 0x0001-0x000521ff] usable
[0.00] NX (Execute Disable) protection: active
[0.00] SMBIOS 2.8 present.
[0.00] DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 
rel-1.12.0-0-ga698c89-rebuilt.suse.com 04/01/2014
[0.00] Hypervisor detected: KVM
[0.00] tsc: Fast TSC calibration using PIT
[0.00] tsc: Detected 2799.858 MHz processor
[0.000348] e820: update [mem 0x-0x0fff] usable ==> reserved
[0.000349] e820: remove [mem 0x000a-0x000f] usable
[0.000354] last_pfn = 0x522000 max_arch_pfn = 0x4
[0.000380] MTRR default type: write-back
[0.000380] MTRR fixed ranges enabled:
[0.000381]   0-9 write-back
[0.000382]   A-B uncachable
[0.000383]   C-F write-protect
[0.000383] MTRR variable ranges enabled:
[0.000384]   0 base 000C000 mask 3FFC000 uncachable
[0.000385]   1 disabled
[0.000385]   2 disabled
[0.000385]   3 disabled
[0.000386]   4 disabled
[0.000386]   5 disabled
[0.000387]   6 disabled
[0.000387]   7 disabled
[0.000394] x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WP  UC- WT  
[0.000408] last_pfn = 0xbffd9 max_arch_pfn = 0x4
[0.015173] check: Scanning 1 areas for low memory corruption
[0.015226] Kernel/User page tables isolation: disabled on command line.
[0.015230] Using GB pages for direct mapping
[0.015416] RAMDISK: [mem 0x7f7a2000-0x7fff]
[0.015459] ACPI: Early table checksum verification disabled
[0.015474] ACPI: RSDP 0x000F5B30 14 (v00 BOCHS )
[0.015477] ACPI: RSDT 0xBFFE2369 30 (v01 BOCHS  BXPCRSDT 
0001 BXPC 0001)
[0.015486] ACPI: FACP 0xBFFE1D4D 74 (v01 BOCHS  BXPCFACP 
0001 BXPC 0001)
[0.015493] ACPI: DSDT 0xBFFDD400 00494D (v01 BOCHS  BXPCDSDT 
0001 BXPC 0001)
[0.015497] ACPI: FACS 0xBFFDD3C0 40
[0.015499] ACPI: APIC 0xBFFE1DC1 000570 (v01 BOCHS  BXPCAPIC 
0001 BXPC 0001)
[0.015502] ACPI: HPET 0xBFFE2331 38 (v01 BOCHS  BXPCHPET 
0001 BXPC 0001)
[0.015512] ACPI: Local APIC address 0xfee0
[0.015847] No NUMA configuration found
[0.015847] Faking a node at [mem 0x-0x000521ff]
[0.015862] NODE_DATA(0) allocated [mem 0x521fea000-0x521ff]
[0.016605] Zone ranges:
[0.016606]   DMA  [mem 0x1000-0x00ff]
[0.016606]   DMA32[mem 0x0100-0x]
[0.016607]   Normal   [mem 0x0001-0x000521ff]
[0.016608]   Device   empty
[0.016608] Movable zone 

[PATCH] scsi: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 drivers/scsi/Kconfig  | 40 +--
 drivers/scsi/hptiop.h |  2 +-
 drivers/scsi/sense_codes.h|  2 +-
 drivers/scsi/smartpqi/Kconfig |  2 +-
 drivers/scsi/smartpqi/smartpqi_init.c |  2 +-
 drivers/scsi/ufs/ti-j721e-ufs.c   |  2 +-
 6 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index e9ff4cd5fbe9..87b0d56c0f61 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -75,7 +75,7 @@ config BLK_DEV_SD
  USB storage or the SCSI or parallel port version of
  the IOMEGA ZIP drive, say Y and read the SCSI-HOWTO,
  the Disk-HOWTO and the Multi-Disk-HOWTO, available from
- . This is NOT for SCSI
+ . This is NOT for SCSI
  CD-ROMs.
 
  To compile this driver as a module, choose M here and read
@@ -93,7 +93,7 @@ config CHR_DEV_ST
help
  If you want to use a SCSI tape drive under Linux, say Y and read the
  SCSI-HOWTO, available from
- , and
+ , and
   in the kernel source.  This is NOT
  for SCSI CD-ROMs.
 
@@ -107,7 +107,7 @@ config BLK_DEV_SR
help
  If you want to use a CD or DVD drive attached to your computer
  by SCSI, FireWire, USB or ATAPI, say Y and read the SCSI-HOWTO
- and the CDROM-HOWTO at .
+ and the CDROM-HOWTO at .
 
  Make sure to say Y or M to "ISO 9660 CD-ROM file system support".
 
@@ -130,7 +130,7 @@ config CHR_DEV_SG
  ()
  and for burning a "disk at once": CDRDAO
  (). Cdparanoia is a high
- quality digital reader of audio CDs ().
+ quality digital reader of audio CDs 
().
  For other devices, it's possible that you'll have to write the
  driver software yourself. Please read the file
   for more information.
@@ -382,7 +382,7 @@ config SCSI_AHA152X
  must be manually specified in this case.
 
  It is explained in section 3.3 of the SCSI-HOWTO, available from
- . You might also want to
+ . You might also want to
  read the file .
 
  To compile this driver as a module, choose M here: the
@@ -394,7 +394,7 @@ config SCSI_AHA1542
help
  This is support for a SCSI host adapter.  It is explained in section
  3.4 of the SCSI-HOWTO, available from
- .  Note that Trantor was
+ .  Note that Trantor was
  purchased by Adaptec, and some former Trantor products are being
  sold under the Adaptec name.  If it doesn't work out of the box, you
  may have to change some settings in .
@@ -408,7 +408,7 @@ config SCSI_AHA1740
help
  This is support for a SCSI host adapter.  It is explained in section
  3.5 of the SCSI-HOWTO, available from
- .  If it doesn't work out
+ .  If it doesn't work out
  of the box, you may have to change some settings in
  .
 
@@ -474,7 +474,7 @@ config SCSI_ARCMSR
  This is an ARECA-maintained driver by 

[PATCH] reset: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 drivers/reset/reset-ti-syscon.c   | 2 +-
 include/dt-bindings/reset/ti-syscon.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/reset/reset-ti-syscon.c b/drivers/reset/reset-ti-syscon.c
index a2635c21db7f..ef97c4dbbb4e 100644
--- a/drivers/reset/reset-ti-syscon.c
+++ b/drivers/reset/reset-ti-syscon.c
@@ -1,7 +1,7 @@
 /*
  * TI SYSCON regmap reset driver
  *
- * Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2015-2016 Texas Instruments Incorporated - https://www.ti.com/
  * Andrew F. Davis 
  * Suman Anna 
  *
diff --git a/include/dt-bindings/reset/ti-syscon.h 
b/include/dt-bindings/reset/ti-syscon.h
index 6d696d2d1508..eacc0f18083e 100644
--- a/include/dt-bindings/reset/ti-syscon.h
+++ b/include/dt-bindings/reset/ti-syscon.h
@@ -2,7 +2,7 @@
 /*
  * TI Syscon Reset definitions
  *
- * Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2015-2016 Texas Instruments Incorporated - https://www.ti.com/
  */
 
 #ifndef __DT_BINDINGS_RESET_TI_SYSCON_H__
-- 
2.27.0



Re: [v2 1/4] coccinelle: api: extend memdup_user transformation with GFP_USER

2020-07-18 Thread Markus Elfring
> You proposed essentially  \( A \| B \) \( | C \| \)

Will the software development attention grow for a topic
like “Extend support for handling of optional source code parts”?
https://github.com/coccinelle/coccinelle/issues/53

How do you think about another tiny example script for the semantic patch 
language?

@display@
constant A, B;
@@
*A
?| B


elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch --parse-cocci 
optional_disjunction_test3-20200718.cocci
…
warning: incompatible arity found on line 4
incompatible minus and plus code starting on lines 4 and 4


Regards,
Markus


Re: [PATCH v5 4/4] printk: use the lockless ringbuffer

2020-07-18 Thread Marco Elver
On Thu, Jul 09, 2020 at 03:29PM +0206, John Ogness wrote:
> Replace the existing ringbuffer usage and implementation with
> lockless ringbuffer usage. Even though the new ringbuffer does not
> require locking, all existing locking is left in place. Therefore,
> this change is purely replacing the underlining ringbuffer.
> 
> Changes that exist due to the ringbuffer replacement:
> 
> - The VMCOREINFO has been updated for the new structures.
> 
> - Dictionary data is now stored in a separate data buffer from the
>   human-readable messages. The dictionary data buffer is set to the
>   same size as the message buffer. Therefore, the total required
>   memory for both dictionary and message data is
>   2 * (2 ^ CONFIG_LOG_BUF_SHIFT) for the initial static buffers and
>   2 * log_buf_len (the kernel parameter) for the dynamic buffers.
> 
> - Record meta-data is now stored in a separate array of descriptors.
>   This is an additional 72 * (2 ^ (CONFIG_LOG_BUF_SHIFT - 5)) bytes
>   for the static array and 72 * (log_buf_len >> 5) bytes for the
>   dynamic array.
> 
> Signed-off-by: John Ogness 
> Reviewed-by: Petr Mladek 

It seems this causes a regression observed at least with newline-only
printks. I noticed this during -next testing because various debugging
tools (K*SAN, lockdep, etc.) use e.g. pr_{err,warn,info}("\n") to format
reports.

Without wanting to wait for a report from one of these debugging tools,
a simple reproducer is below. Without this patch, the expected newline
is printed.

Thanks,
-- Marco

-- >8 --

--- a/init/main.c
+++ b/init/main.c
@@ -1039,6 +1039,10 @@ asmlinkage __visible void __init start_kernel(void)
sfi_init_late();
kcsan_init();
 
+   pr_info("EXPECT BLANK LINE --vv\n");
+   pr_info("\n");
+   pr_info("EXPECT BLANK LINE --^^\n");
+
/* Do the rest non-__init'ed, we're now alive */
arch_call_rest_init();
 


[PATCH] pinctl: ti: iodelay: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c 
b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
index b522ca010332..cfb924228d87 100644
--- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
+++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
@@ -2,7 +2,7 @@
  * Support for configuration of IO Delay module found on Texas Instruments SoCs
  * such as DRA7
  *
- * Copyright (C) 2015-2017 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2015-2017 Texas Instruments Incorporated - https://www.ti.com/
  *
  * This file is licensed under the terms of the GNU General Public
  * License version 2. This program is licensed "as is" without any
-- 
2.27.0



[PATCH -next] net: ena: use NULL instead of zero

2020-07-18 Thread Wang Hai
Fix sparse build warning:

drivers/net/ethernet/amazon/ena/ena_netdev.c:2193:34: warning:
 Using plain integer as NULL pointer

Reported-by: Hulk Robot 
Signed-off-by: Wang Hai 
---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c 
b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 91be3ffa1c5c..11303a4b94be 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -2190,7 +2190,7 @@ static void ena_del_napi_in_range(struct ena_adapter 
*adapter,
 static void ena_init_napi_in_range(struct ena_adapter *adapter,
   int first_index, int count)
 {
-   struct ena_napi *napi = {0};
+   struct ena_napi *napi = NULL;
int i;
 
for (i = first_index; i < first_index + count; i++) {
-- 
2.17.1



[PATCH] irqchip: crossbar: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 drivers/irqchip/irq-crossbar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-crossbar.c b/drivers/irqchip/irq-crossbar.c
index a05a7501e107..9e1839966d1e 100644
--- a/drivers/irqchip/irq-crossbar.c
+++ b/drivers/irqchip/irq-crossbar.c
@@ -2,7 +2,7 @@
 /*
  *  drivers/irqchip/irq-crossbar.c
  *
- *  Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
+ *  Copyright (C) 2013 Texas Instruments Incorporated - https://www.ti.com
  *  Author: Sricharan R 
  */
 #include 
-- 
2.27.0



Re: [PATCH v6 2/4] drm/imx: Add initial support for DCSS on iMX8MQ

2020-07-18 Thread Sam Ravnborg
On Sat, Jul 18, 2020 at 01:05:25PM +0200, Guido Günther wrote:
> Hi,
> On Fri, Jul 17, 2020 at 09:48:49PM +0200, Sam Ravnborg wrote:
> > Hi Laurentiu.
> > 
> > On Fri, Jul 17, 2020 at 05:41:27PM +0300, Laurentiu Palcu wrote:
> > > From: Laurentiu Palcu 
> > > 
> > > This adds initial support for iMX8MQ's Display Controller Subsystem 
> > > (DCSS).
> > > Some of its capabilities include:
> > >  * 4K@60fps;
> > >  * HDR10;
> > >  * one graphics and 2 video pipelines;
> > >  * on-the-fly decompression of compressed video and graphics;
> > > 
> > > The reference manual can be found here:
> > > https://www.nxp.com/webapp/Download?colCode=IMX8MDQLQRM
> > > 
> > > The current patch adds only basic functionality: one primary plane for
> > > graphics, linear, tiled and super-tiled buffers support (no graphics
> > > decompression yet), no HDR10 and no video planes.
> > > 
> > > Video planes support and HDR10 will be added in subsequent patches once
> > > per-plane de-gamma/CSC/gamma support is in.
> > > 
> > > Signed-off-by: Laurentiu Palcu 
> > > Reviewed-by: Lucas Stach 
> > > ---
> > 
> > 
> > return drm_bridge_attach(encoder, bridge, NULL, 0);
> > 
> > 
> > The above code-snippet tells that the display-driver rely on the bridge
> > to create the connector.
> > Could this by any chance be updated to the new way where the display
> > driver creates the connector - and thus passing 
> > DRM_BRIDGE_ATTACH_NO_CONNECTOR
> > as the flags argument?
> > 
> > What bridges would be relevant?
> > To check that the reelvant bridges are already ported.
> 
> I think that's mostly NWL atm since MHDP isn't mainline yet. Can you
> recommend a bridge driver to look at that does this right?

Hi Guido.

The following is from my notes:

bridge/adv7511 done
bridge/simple-bridge   done
bridge/synopsys/dw-hdmidone
bridge/display-connector.c done
bridge/lvds-codec  done
bridge/cdns-dsidone
bridge/panel.c done
bridge/parade-ps8640   done
bridge/sil-sii8620 done
bridge/synopsys/dw-mipi-dsidone
bridge/tc358768done
bridge/thc63lvd1024done
bridge/ti-tfp410   done

This is a list of bridge drivers which are converted and in
drm-misc-next now.
I have a patch set that converts some more but they needs a bit more
polishing before they are done.

Laurent has written about is in a very comprehensive way several times.
The short variant is that we needed to support chained bridges where
the individual bridges implemented the functions required by the
connector - and creating the connector was pushed back to the display
driver.
So the bridges now announce their support of for example hot-plug detect
and reading edid. Then the connector, created by the display driver, can
use the operations exported by the bridge drivers.

Sam


Re: [PATCH v2] ntfs: Fix ntfs_test_inode and ntfs_init_locked_inode function type

2020-07-18 Thread Anton Altaparmakov
Hi Andrew,

Please can you merge this patch?  Thanks a lot in advance!

Luca, thank you for the updated patch!

Best regards,

Anton

> On 18 Jul 2020, at 12:25, Luca Stefani  wrote:
> 
> Clang's Control Flow Integrity (CFI) is a security mechanism that can
> help prevent JOP chains, deployed extensively in downstream kernels
> used in Android.
> 
> It's deployment is hindered by mismatches in function signatures.  For
> this case, we make callbacks match their intended function signature,
> and cast parameters within them rather than casting the callback when
> passed as a parameter.
> 
> When running `mount -t ntfs ...` we observe the following trace:
> 
> Call trace:
> __cfi_check_fail+0x1c/0x24
> name_to_dev_t+0x0/0x404
> iget5_locked+0x594/0x5e8
> ntfs_fill_super+0xbfc/0x43ec
> mount_bdev+0x30c/0x3cc
> ntfs_mount+0x18/0x24
> mount_fs+0x1b0/0x380
> vfs_kern_mount+0x90/0x398
> do_mount+0x5d8/0x1a10
> SyS_mount+0x108/0x144
> el0_svc_naked+0x34/0x38
> 
> Signed-off-by: Luca Stefani 
> Tested-by: freak07 
> Acked-by: Anton Altaparmakov 
> ---
> fs/ntfs/dir.c   |  2 +-
> fs/ntfs/inode.c | 27 ++-
> fs/ntfs/inode.h |  4 +---
> fs/ntfs/mft.c   |  4 ++--
> 4 files changed, 18 insertions(+), 19 deletions(-)
> 
> diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c
> index 3c4811469ae8..e278bfc5ee7f 100644
> --- a/fs/ntfs/dir.c
> +++ b/fs/ntfs/dir.c
> @@ -1503,7 +1503,7 @@ static int ntfs_dir_fsync(struct file *filp, loff_t 
> start, loff_t end,
>   na.type = AT_BITMAP;
>   na.name = I30;
>   na.name_len = 4;
> - bmp_vi = ilookup5(vi->i_sb, vi->i_ino, (test_t)ntfs_test_inode, );
> + bmp_vi = ilookup5(vi->i_sb, vi->i_ino, ntfs_test_inode, );
>   if (bmp_vi) {
>   write_inode_now(bmp_vi, !datasync);
>   iput(bmp_vi);
> diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
> index d4359a1df3d5..9bb9f0952b18 100644
> --- a/fs/ntfs/inode.c
> +++ b/fs/ntfs/inode.c
> @@ -30,10 +30,10 @@
> /**
>  * ntfs_test_inode - compare two (possibly fake) inodes for equality
>  * @vi:   vfs inode which to test
> - * @na:  ntfs attribute which is being tested with
> + * @data:data which is being tested with
>  *
>  * Compare the ntfs attribute embedded in the ntfs specific part of the vfs
> - * inode @vi for equality with the ntfs attribute @na.
> + * inode @vi for equality with the ntfs attribute @data.
>  *
>  * If searching for the normal file/directory inode, set @na->type to 
> AT_UNUSED.
>  * @na->name and @na->name_len are then ignored.
> @@ -43,8 +43,9 @@
>  * NOTE: This function runs with the inode_hash_lock spin lock held so it is 
> not
>  * allowed to sleep.
>  */
> -int ntfs_test_inode(struct inode *vi, ntfs_attr *na)
> +int ntfs_test_inode(struct inode *vi, void *data)
> {
> + ntfs_attr *na = (ntfs_attr *)data;
>   ntfs_inode *ni;
> 
>   if (vi->i_ino != na->mft_no)
> @@ -72,9 +73,9 @@ int ntfs_test_inode(struct inode *vi, ntfs_attr *na)
> /**
>  * ntfs_init_locked_inode - initialize an inode
>  * @vi:   vfs inode to initialize
> - * @na:  ntfs attribute which to initialize @vi to
> + * @data:data which to initialize @vi to
>  *
> - * Initialize the vfs inode @vi with the values from the ntfs attribute @na 
> in
> + * Initialize the vfs inode @vi with the values from the ntfs attribute 
> @data in
>  * order to enable ntfs_test_inode() to do its work.
>  *
>  * If initializing the normal file/directory inode, set @na->type to 
> AT_UNUSED.
> @@ -87,8 +88,9 @@ int ntfs_test_inode(struct inode *vi, ntfs_attr *na)
>  * NOTE: This function runs with the inode->i_lock spin lock held so it is not
>  * allowed to sleep. (Hence the GFP_ATOMIC allocation.)
>  */
> -static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na)
> +static int ntfs_init_locked_inode(struct inode *vi, void *data)
> {
> + ntfs_attr *na = (ntfs_attr *)data;
>   ntfs_inode *ni = NTFS_I(vi);
> 
>   vi->i_ino = na->mft_no;
> @@ -131,7 +133,6 @@ static int ntfs_init_locked_inode(struct inode *vi, 
> ntfs_attr *na)
>   return 0;
> }
> 
> -typedef int (*set_t)(struct inode *, void *);
> static int ntfs_read_locked_inode(struct inode *vi);
> static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode 
> *vi);
> static int ntfs_read_locked_index_inode(struct inode *base_vi,
> @@ -164,8 +165,8 @@ struct inode *ntfs_iget(struct super_block *sb, unsigned 
> long mft_no)
>   na.name = NULL;
>   na.name_len = 0;
> 
> - vi = iget5_locked(sb, mft_no, (test_t)ntfs_test_inode,
> - (set_t)ntfs_init_locked_inode, );
> + vi = iget5_locked(sb, mft_no, ntfs_test_inode,
> + ntfs_init_locked_inode, );
>   if (unlikely(!vi))
>   return ERR_PTR(-ENOMEM);
> 
> @@ -225,8 +226,8 @@ struct inode *ntfs_attr_iget(struct inode *base_vi, 
> ATTR_TYPE type,
>   na.name = name;
>   na.name_len = name_len;
> 
> - vi = 

[PATCH] e100: switch from 'pci_' to 'dma_' API

2020-07-18 Thread Christophe JAILLET
The wrappers in include/linux/pci-dma-compat.h should go away.

The patch has been generated with the coccinelle script below and has been
hand modified to replace GFP_ with a correct flag.
It has been compile tested.

When memory is allocated in 'e100_alloc()', GFP_KERNEL can be used because
it is only called from the probe function and no lock is acquired.


@@
@@
-PCI_DMA_BIDIRECTIONAL
+DMA_BIDIRECTIONAL

@@
@@
-PCI_DMA_TODEVICE
+DMA_TO_DEVICE

@@
@@
-PCI_DMA_FROMDEVICE
+DMA_FROM_DEVICE

@@
@@
-PCI_DMA_NONE
+DMA_NONE

@@
expression e1, e2, e3;
@@
-pci_alloc_consistent(e1, e2, e3)
+dma_alloc_coherent(>dev, e2, e3, GFP_)

@@
expression e1, e2, e3;
@@
-pci_zalloc_consistent(e1, e2, e3)
+dma_alloc_coherent(>dev, e2, e3, GFP_)

@@
expression e1, e2, e3, e4;
@@
-pci_free_consistent(e1, e2, e3, e4)
+dma_free_coherent(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_map_single(e1, e2, e3, e4)
+dma_map_single(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_unmap_single(e1, e2, e3, e4)
+dma_unmap_single(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4, e5;
@@
-pci_map_page(e1, e2, e3, e4, e5)
+dma_map_page(>dev, e2, e3, e4, e5)

@@
expression e1, e2, e3, e4;
@@
-pci_unmap_page(e1, e2, e3, e4)
+dma_unmap_page(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_map_sg(e1, e2, e3, e4)
+dma_map_sg(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_unmap_sg(e1, e2, e3, e4)
+dma_unmap_sg(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+dma_sync_single_for_cpu(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_dma_sync_single_for_device(e1, e2, e3, e4)
+dma_sync_single_for_device(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+dma_sync_sg_for_cpu(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+dma_sync_sg_for_device(>dev, e2, e3, e4)

@@
expression e1, e2;
@@
-pci_dma_mapping_error(e1, e2)
+dma_mapping_error(>dev, e2)

@@
expression e1, e2;
@@
-pci_set_dma_mask(e1, e2)
+dma_set_mask(>dev, e2)

@@
expression e1, e2;
@@
-pci_set_consistent_dma_mask(e1, e2)
+dma_set_coherent_mask(>dev, e2)

Signed-off-by: Christophe JAILLET 
---
If needed, see post from Christoph Hellwig on the kernel-janitors ML:
   https://marc.info/?l=kernel-janitors=158745678307186=4
---
 drivers/net/ethernet/intel/e100.c | 92 ---
 1 file changed, 49 insertions(+), 43 deletions(-)

diff --git a/drivers/net/ethernet/intel/e100.c 
b/drivers/net/ethernet/intel/e100.c
index 91c64f91a835..ec6b1024cd8a 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -1739,10 +1739,10 @@ static int e100_xmit_prepare(struct nic *nic, struct cb 
*cb,
dma_addr_t dma_addr;
cb->command = nic->tx_command;
 
-   dma_addr = pci_map_single(nic->pdev,
- skb->data, skb->len, PCI_DMA_TODEVICE);
+   dma_addr = dma_map_single(>pdev->dev, skb->data, skb->len,
+ DMA_TO_DEVICE);
/* If we can't map the skb, have the upper layer try later */
-   if (pci_dma_mapping_error(nic->pdev, dma_addr)) {
+   if (dma_mapping_error(>pdev->dev, dma_addr)) {
dev_kfree_skb_any(skb);
skb = NULL;
return -ENOMEM;
@@ -1828,10 +1828,10 @@ static int e100_tx_clean(struct nic *nic)
dev->stats.tx_packets++;
dev->stats.tx_bytes += cb->skb->len;
 
-   pci_unmap_single(nic->pdev,
-   le32_to_cpu(cb->u.tcb.tbd.buf_addr),
-   le16_to_cpu(cb->u.tcb.tbd.size),
-   PCI_DMA_TODEVICE);
+   dma_unmap_single(>pdev->dev,
+le32_to_cpu(cb->u.tcb.tbd.buf_addr),
+le16_to_cpu(cb->u.tcb.tbd.size),
+DMA_TO_DEVICE);
dev_kfree_skb_any(cb->skb);
cb->skb = NULL;
tx_cleaned = 1;
@@ -1855,10 +1855,10 @@ static void e100_clean_cbs(struct nic *nic)
while (nic->cbs_avail != nic->params.cbs.count) {
struct cb *cb = nic->cb_to_clean;
if (cb->skb) {
-   pci_unmap_single(nic->pdev,
-   le32_to_cpu(cb->u.tcb.tbd.buf_addr),
-   le16_to_cpu(cb->u.tcb.tbd.size),
-   PCI_DMA_TODEVICE);
+   dma_unmap_single(>pdev->dev,
+
le32_to_cpu(cb->u.tcb.tbd.buf_addr),
+ 

[PATCH -next] bpf: Make some functions static

2020-07-18 Thread Wang Hai
Fix sparse build warning:

net/bpf/test_run.c:120:14: warning:
 symbol 'bpf_fentry_test1' was not declared. Should it be static?
net/bpf/test_run.c:125:14: warning:
 symbol 'bpf_fentry_test2' was not declared. Should it be static?
net/bpf/test_run.c:130:14: warning:
 symbol 'bpf_fentry_test3' was not declared. Should it be static?
net/bpf/test_run.c:135:14: warning:
 symbol 'bpf_fentry_test4' was not declared. Should it be static?
net/bpf/test_run.c:140:14: warning:
 symbol 'bpf_fentry_test5' was not declared. Should it be static?
net/bpf/test_run.c:145:14: warning:
 symbol 'bpf_fentry_test6' was not declared. Should it be static?
net/bpf/test_run.c:154:14: warning:
 symbol 'bpf_fentry_test7' was not declared. Should it be static?
net/bpf/test_run.c:159:14: warning:
 symbol 'bpf_fentry_test8' was not declared. Should it be static?
net/bpf/test_run.c:164:14: warning:
 symbol 'bpf_modify_return_test' was not declared. Should it be static?

Reported-by: Hulk Robot 
Signed-off-by: Wang Hai 
---
 net/bpf/test_run.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
index b03c469cd01f..0d78bd9b6c9d 100644
--- a/net/bpf/test_run.c
+++ b/net/bpf/test_run.c
@@ -117,32 +117,32 @@ static int bpf_test_finish(const union bpf_attr *kattr,
 __diag_push();
 __diag_ignore(GCC, 8, "-Wmissing-prototypes",
  "Global functions as their definitions will be in vmlinux BTF");
-int noinline bpf_fentry_test1(int a)
+static noinline int bpf_fentry_test1(int a)
 {
return a + 1;
 }
 
-int noinline bpf_fentry_test2(int a, u64 b)
+static noinline int bpf_fentry_test2(int a, u64 b)
 {
return a + b;
 }
 
-int noinline bpf_fentry_test3(char a, int b, u64 c)
+static noinline int bpf_fentry_test3(char a, int b, u64 c)
 {
return a + b + c;
 }
 
-int noinline bpf_fentry_test4(void *a, char b, int c, u64 d)
+static noinline int bpf_fentry_test4(void *a, char b, int c, u64 d)
 {
return (long)a + b + c + d;
 }
 
-int noinline bpf_fentry_test5(u64 a, void *b, short c, int d, u64 e)
+static noinline int bpf_fentry_test5(u64 a, void *b, short c, int d, u64 e)
 {
return a + (long)b + c + d + e;
 }
 
-int noinline bpf_fentry_test6(u64 a, void *b, short c, int d, void *e, u64 f)
+static noinline int bpf_fentry_test6(u64 a, void *b, short c, int d, void *e, 
u64 f)
 {
return a + (long)b + c + d + (long)e + f;
 }
@@ -151,17 +151,17 @@ struct bpf_fentry_test_t {
struct bpf_fentry_test_t *a;
 };
 
-int noinline bpf_fentry_test7(struct bpf_fentry_test_t *arg)
+static noinline int bpf_fentry_test7(struct bpf_fentry_test_t *arg)
 {
return (long)arg;
 }
 
-int noinline bpf_fentry_test8(struct bpf_fentry_test_t *arg)
+static noinline int bpf_fentry_test8(struct bpf_fentry_test_t *arg)
 {
return (long)arg->a;
 }
 
-int noinline bpf_modify_return_test(int a, int *b)
+static noinline int bpf_modify_return_test(int a, int *b)
 {
*b += 1;
return a + *b;
-- 
2.17.1



memory leak in veth_dev_init

2020-07-18 Thread syzbot
Hello,

syzbot found the following issue on:

HEAD commit:e9919e11 Merge branch 'for-linus' of git://git.kernel.org/..
git tree:   upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17058f5710
kernel config:  https://syzkaller.appspot.com/x/.config?x=175942c28d9b8dd0
dashboard link: https://syzkaller.appspot.com/bug?extid=59ef240dd8f0ed7598a8
compiler:   gcc (GCC) 10.1.0-syz 20200507
syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=12f9570090

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+59ef240dd8f0ed759...@syzkaller.appspotmail.com

BUG: memory leak
unreferenced object 0x8881097d2400 (size 1024):
  comm "syz-executor.2", pid 6690, jiffies 4295037413 (age 16.990s)
  hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  
  backtrace:
[] kmalloc_array include/linux/slab.h:597 [inline]
[] kcalloc include/linux/slab.h:608 [inline]
[] veth_alloc_queues drivers/net/veth.c:1018 [inline]
[] veth_dev_init+0x7b/0x120 drivers/net/veth.c:1045
[<3f373d1e>] register_netdevice+0x143/0x760 net/core/dev.c:9444
[] veth_newlink+0x1d5/0x460 drivers/net/veth.c:1366
[<8d2f627f>] __rtnl_newlink+0x8f3/0xbb0 net/core/rtnetlink.c:3339
[<8e87c660>] rtnl_newlink+0x49/0x70 net/core/rtnetlink.c:3397
[<2569c6f3>] rtnetlink_rcv_msg+0x17e/0x460 net/core/rtnetlink.c:5460
[] netlink_rcv_skb+0x5b/0x180 
net/netlink/af_netlink.c:2469
[<06d33309>] netlink_unicast_kernel net/netlink/af_netlink.c:1303 
[inline]
[<06d33309>] netlink_unicast+0x2b6/0x3c0 
net/netlink/af_netlink.c:1329
[<2d1084c2>] netlink_sendmsg+0x2ba/0x570 
net/netlink/af_netlink.c:1918
[<2ba4c104>] sock_sendmsg_nosec net/socket.c:652 [inline]
[<2ba4c104>] sock_sendmsg+0x4c/0x60 net/socket.c:672
[] __sys_sendto+0x11d/0x1c0 net/socket.c:1995
[] __do_sys_sendto net/socket.c:2007 [inline]
[] __se_sys_sendto net/socket.c:2003 [inline]
[] __x64_sys_sendto+0x26/0x30 net/socket.c:2003
[<4ab49ca5>] do_syscall_64+0x4c/0xe0 arch/x86/entry/common.c:384
[] entry_SYSCALL_64_after_hwframe+0x44/0xa9



---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkal...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches


Re: [PATCH 2/4] staging: rtl8188eu: include: fixed multiple parentheses coding style issues

2020-07-18 Thread kernel test robot
Hi K,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]

url:
https://github.com/0day-ci/linux/commits/B-K-Karthik/staging-rtl8188eu-include-fixed-multiple-blank-space-coding-style-issues/20200718-172103
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
9d5d041eebe3dcf7591ff7004896c329eb841ca6
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
ARCH=m68k 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All warnings (new ones prefixed by >>):

   In file included from arch/m68k/include/asm/io_mm.h:25,
from arch/m68k/include/asm/io.h:8,
from include/linux/scatterlist.h:9,
from include/linux/dma-mapping.h:11,
from include/linux/skbuff.h:31,
from include/linux/if_ether.h:19,
from include/linux/ieee80211.h:19,
from drivers/staging/rtl8188eu/core/rtw_ap.c:9:
   arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsb':
   arch/m68k/include/asm/raw_io.h:83:7: warning: variable '__w' set but not 
used [-Wunused-but-set-variable]
  83 |  ({u8 __w, __v = (b);  u32 _addr = ((u32) (addr)); \
 |   ^~~
   arch/m68k/include/asm/raw_io.h:430:3: note: in expansion of macro 'rom_out_8'
 430 |   rom_out_8(port, *buf++);
 |   ^
   arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw':
   arch/m68k/include/asm/raw_io.h:86:8: warning: variable '__w' set but not 
used [-Wunused-but-set-variable]
  86 |  ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
 |^~~
   arch/m68k/include/asm/raw_io.h:448:3: note: in expansion of macro 
'rom_out_be16'
 448 |   rom_out_be16(port, *buf++);
 |   ^~~~
   arch/m68k/include/asm/raw_io.h: In function 'raw_rom_outsw_swapw':
   arch/m68k/include/asm/raw_io.h:90:8: warning: variable '__w' set but not 
used [-Wunused-but-set-variable]
  90 |  ({u16 __w, __v = (w); u32 _addr = ((u32) (addr)); \
 |^~~
   arch/m68k/include/asm/raw_io.h:466:3: note: in expansion of macro 
'rom_out_le16'
 466 |   rom_out_le16(port, *buf++);
 |   ^~~~
   In file included from include/linux/kernel.h:11,
from include/linux/skbuff.h:13,
from include/linux/if_ether.h:19,
from include/linux/ieee80211.h:19,
from drivers/staging/rtl8188eu/core/rtw_ap.c:9:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of 
pointer with null pointer [-Wextra]
 169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void 
*)PAGE_OFFSET && (void *)(kaddr) < high_memory)
 | ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
  78 | # define unlikely(x) __builtin_expect(!!(x), 0)
 |  ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
 143 |  BUG_ON(!virt_addr_valid(buf));
 |  ^~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 
'virt_addr_valid'
 143 |  BUG_ON(!virt_addr_valid(buf));
 |  ^~~
   In file included from arch/m68k/include/asm/bug.h:32,
from include/linux/bug.h:5,
from include/linux/thread_info.h:12,
from include/asm-generic/preempt.h:5,
from ./arch/m68k/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:51,
from include/linux/seqlock.h:36,
from include/linux/time.h:6,
from include/linux/skbuff.h:15,
from include/linux/if_ether.h:19,
from include/linux/ieee80211.h:19,
from drivers/staging/rtl8188eu/core/rtw_ap.c:9:
   include/linux/dma-mapping.h: In function 'dma_map_resource':
   arch/m68k/include/asm/page_mm.h:169:49: warning: ordered comparison of 
pointer with null pointer [-Wextra]
 169 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void 
*)PAGE_OFFSET && (void *)(kaddr) < high_memory)
 | ^~
   include/asm-generic/bug.h:144:27: note: in definition of macro 'WARN_ON_ONCE'
 144 |  

[PATCH] HID: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master
 (Actually letting a shell for loop submit all this stuff for me.)

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.

 Sorry again to all maintainers who complained about subject lines.
 Now I realized that you want an actually perfect prefixes,
 not just subsystem ones.
 I tried my best...
 And yes, *I could* (at least half-)automate it.
 Impossible is nothing! :)


 drivers/hid/Kconfig  | 2 +-
 drivers/hid/hid-cp2112.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 45e87dc59d4e..05315b434276 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -20,7 +20,7 @@ config HID
  removed from the HID bus by the transport-layer drivers, such as
  usbhid (USB_HID) and hidp (BT_HIDP).
 
- For docs and specs, see http://www.usb.org/developers/hidpage/
+ For docs and specs, see https://www.usb.org/developers/hidpage/
 
  If unsure, say Y.
 
diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index db1b55df0d13..f64517bc33e2 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -11,7 +11,7 @@
  * host communicates with the CP2112 via raw HID reports.
  *
  * Data Sheet:
- *   http://www.silabs.com/Support%20Documents/TechnicalDocs/CP2112.pdf
+ *   https://www.silabs.com/Support%20Documents/TechnicalDocs/CP2112.pdf
  * Programming Interface Specification:
  *   
https://www.silabs.com/documents/public/application-notes/an495-cp2112-interface-specification.pdf
  */
-- 
2.27.0



[PATCH] scsi: hptiop: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.


 Documentation/scsi/hptiop.rst | 2 +-
 drivers/scsi/hptiop.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/scsi/hptiop.rst b/Documentation/scsi/hptiop.rst
index 23ae7ae36971..1a6900b456c0 100644
--- a/Documentation/scsi/hptiop.rst
+++ b/Documentation/scsi/hptiop.rst
@@ -212,4 +212,4 @@ Copyright |copy| 2006-2012 HighPoint Technologies, Inc. All 
Rights Reserved.
 
   li...@highpoint-tech.com
 
-  http://www.highpoint-tech.com
+  https://www.highpoint-tech.com
diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c
index 6a2561f26e38..3299624e41ce 100644
--- a/drivers/scsi/hptiop.c
+++ b/drivers/scsi/hptiop.c
@@ -5,7 +5,7 @@
  *
  * Please report bugs/comments/suggestions to li...@highpoint-tech.com
  *
- * For more information, visit http://www.highpoint-tech.com
+ * For more information, visit https://www.highpoint-tech.com
  */
 #include 
 #include 
-- 
2.27.0



[PATCH v2] ntfs: Fix ntfs_test_inode and ntfs_init_locked_inode function type

2020-07-18 Thread Luca Stefani
Clang's Control Flow Integrity (CFI) is a security mechanism that can
help prevent JOP chains, deployed extensively in downstream kernels
used in Android.

It's deployment is hindered by mismatches in function signatures.  For
this case, we make callbacks match their intended function signature,
and cast parameters within them rather than casting the callback when
passed as a parameter.

When running `mount -t ntfs ...` we observe the following trace:

Call trace:
__cfi_check_fail+0x1c/0x24
name_to_dev_t+0x0/0x404
iget5_locked+0x594/0x5e8
ntfs_fill_super+0xbfc/0x43ec
mount_bdev+0x30c/0x3cc
ntfs_mount+0x18/0x24
mount_fs+0x1b0/0x380
vfs_kern_mount+0x90/0x398
do_mount+0x5d8/0x1a10
SyS_mount+0x108/0x144
el0_svc_naked+0x34/0x38

Signed-off-by: Luca Stefani 
Tested-by: freak07 
Acked-by: Anton Altaparmakov 
---
 fs/ntfs/dir.c   |  2 +-
 fs/ntfs/inode.c | 27 ++-
 fs/ntfs/inode.h |  4 +---
 fs/ntfs/mft.c   |  4 ++--
 4 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c
index 3c4811469ae8..e278bfc5ee7f 100644
--- a/fs/ntfs/dir.c
+++ b/fs/ntfs/dir.c
@@ -1503,7 +1503,7 @@ static int ntfs_dir_fsync(struct file *filp, loff_t 
start, loff_t end,
na.type = AT_BITMAP;
na.name = I30;
na.name_len = 4;
-   bmp_vi = ilookup5(vi->i_sb, vi->i_ino, (test_t)ntfs_test_inode, );
+   bmp_vi = ilookup5(vi->i_sb, vi->i_ino, ntfs_test_inode, );
if (bmp_vi) {
write_inode_now(bmp_vi, !datasync);
iput(bmp_vi);
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c
index d4359a1df3d5..9bb9f0952b18 100644
--- a/fs/ntfs/inode.c
+++ b/fs/ntfs/inode.c
@@ -30,10 +30,10 @@
 /**
  * ntfs_test_inode - compare two (possibly fake) inodes for equality
  * @vi:vfs inode which to test
- * @na:ntfs attribute which is being tested with
+ * @data:  data which is being tested with
  *
  * Compare the ntfs attribute embedded in the ntfs specific part of the vfs
- * inode @vi for equality with the ntfs attribute @na.
+ * inode @vi for equality with the ntfs attribute @data.
  *
  * If searching for the normal file/directory inode, set @na->type to 
AT_UNUSED.
  * @na->name and @na->name_len are then ignored.
@@ -43,8 +43,9 @@
  * NOTE: This function runs with the inode_hash_lock spin lock held so it is 
not
  * allowed to sleep.
  */
-int ntfs_test_inode(struct inode *vi, ntfs_attr *na)
+int ntfs_test_inode(struct inode *vi, void *data)
 {
+   ntfs_attr *na = (ntfs_attr *)data;
ntfs_inode *ni;
 
if (vi->i_ino != na->mft_no)
@@ -72,9 +73,9 @@ int ntfs_test_inode(struct inode *vi, ntfs_attr *na)
 /**
  * ntfs_init_locked_inode - initialize an inode
  * @vi:vfs inode to initialize
- * @na:ntfs attribute which to initialize @vi to
+ * @data:  data which to initialize @vi to
  *
- * Initialize the vfs inode @vi with the values from the ntfs attribute @na in
+ * Initialize the vfs inode @vi with the values from the ntfs attribute @data 
in
  * order to enable ntfs_test_inode() to do its work.
  *
  * If initializing the normal file/directory inode, set @na->type to AT_UNUSED.
@@ -87,8 +88,9 @@ int ntfs_test_inode(struct inode *vi, ntfs_attr *na)
  * NOTE: This function runs with the inode->i_lock spin lock held so it is not
  * allowed to sleep. (Hence the GFP_ATOMIC allocation.)
  */
-static int ntfs_init_locked_inode(struct inode *vi, ntfs_attr *na)
+static int ntfs_init_locked_inode(struct inode *vi, void *data)
 {
+   ntfs_attr *na = (ntfs_attr *)data;
ntfs_inode *ni = NTFS_I(vi);
 
vi->i_ino = na->mft_no;
@@ -131,7 +133,6 @@ static int ntfs_init_locked_inode(struct inode *vi, 
ntfs_attr *na)
return 0;
 }
 
-typedef int (*set_t)(struct inode *, void *);
 static int ntfs_read_locked_inode(struct inode *vi);
 static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode 
*vi);
 static int ntfs_read_locked_index_inode(struct inode *base_vi,
@@ -164,8 +165,8 @@ struct inode *ntfs_iget(struct super_block *sb, unsigned 
long mft_no)
na.name = NULL;
na.name_len = 0;
 
-   vi = iget5_locked(sb, mft_no, (test_t)ntfs_test_inode,
-   (set_t)ntfs_init_locked_inode, );
+   vi = iget5_locked(sb, mft_no, ntfs_test_inode,
+   ntfs_init_locked_inode, );
if (unlikely(!vi))
return ERR_PTR(-ENOMEM);
 
@@ -225,8 +226,8 @@ struct inode *ntfs_attr_iget(struct inode *base_vi, 
ATTR_TYPE type,
na.name = name;
na.name_len = name_len;
 
-   vi = iget5_locked(base_vi->i_sb, na.mft_no, (test_t)ntfs_test_inode,
-   (set_t)ntfs_init_locked_inode, );
+   vi = iget5_locked(base_vi->i_sb, na.mft_no, ntfs_test_inode,
+   ntfs_init_locked_inode, );
if (unlikely(!vi))
return ERR_PTR(-ENOMEM);
 
@@ -280,8 +281,8 @@ struct inode *ntfs_index_iget(struct inode 

[PATCH] ASoC: omap: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.


 sound/soc/ti/omap-hdmi.c| 2 +-
 sound/soc/ti/omap-twl4030.c | 2 +-
 sound/soc/ti/sdma-pcm.c | 2 +-
 sound/soc/ti/sdma-pcm.h | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/ti/omap-hdmi.c b/sound/soc/ti/omap-hdmi.c
index def2a0ce8886..3328c02f93c7 100644
--- a/sound/soc/ti/omap-hdmi.c
+++ b/sound/soc/ti/omap-hdmi.c
@@ -2,7 +2,7 @@
 /*
  * omap-hdmi-audio.c -- OMAP4+ DSS HDMI audio support library
  *
- * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (C) 2014 Texas Instruments Incorporated - https://www.ti.com
  *
  * Author: Jyri Sarha 
  */
diff --git a/sound/soc/ti/omap-twl4030.c b/sound/soc/ti/omap-twl4030.c
index 92dbe2c67290..4b408cec7a90 100644
--- a/sound/soc/ti/omap-twl4030.c
+++ b/sound/soc/ti/omap-twl4030.c
@@ -2,7 +2,7 @@
 /*
  * omap-twl4030.c  --  SoC audio for TI SoC based boards with twl4030 codec
  *
- * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (C) 2012 Texas Instruments Incorporated - https://www.ti.com
  * All rights reserved.
  *
  * Author: Peter Ujfalusi 
diff --git a/sound/soc/ti/sdma-pcm.c b/sound/soc/ti/sdma-pcm.c
index 2b0bc234e1b6..9e7691103f05 100644
--- a/sound/soc/ti/sdma-pcm.c
+++ b/sound/soc/ti/sdma-pcm.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- *  Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com
+ *  Copyright (C) 2018 Texas Instruments Incorporated - https://www.ti.com
  *  Author: Peter Ujfalusi 
  */
 
diff --git a/sound/soc/ti/sdma-pcm.h b/sound/soc/ti/sdma-pcm.h
index cb0627c8dd34..c19efb4c043d 100644
--- a/sound/soc/ti/sdma-pcm.h
+++ b/sound/soc/ti/sdma-pcm.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- *  Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com
+ *  Copyright (C) 2018 Texas Instruments Incorporated - https://www.ti.com
  *  Author: Peter Ujfalusi 
  */
 
-- 
2.27.0



Re: [PATCH] net: dsa: qca8k: implement the port MTU callbacks

2020-07-18 Thread Jonathan McDowell
On Sat, Jul 18, 2020 at 01:38:08PM +0300, Vladimir Oltean wrote:
> On Sat, Jul 18, 2020 at 10:35:55AM +0100, Jonathan McDowell wrote:
> > This switch has a single max frame size configuration register, so we
> > track the requested MTU for each port and apply the largest.
> > 
> > Signed-off-by: Jonathan McDowell 
> > ---
> >  drivers/net/dsa/qca8k.c | 38 ++
> >  drivers/net/dsa/qca8k.h |  3 +++
> >  2 files changed, 41 insertions(+)
> > 
> > diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
> > index 4acad5fa0c84..3690f02aea3a 100644
> > --- a/drivers/net/dsa/qca8k.c
> > +++ b/drivers/net/dsa/qca8k.c
> > @@ -670,6 +670,12 @@ qca8k_setup(struct dsa_switch *ds)
> > }
> > }
> >  
> > +   /* Setup our port MTUs to match power on defaults */
> > +   for (i = 0; i < QCA8K_NUM_PORTS; i++) {
> > +   priv->port_mtu[i] = ETH_FRAME_LEN + ETH_FCS_LEN;
> > +   }
> 
> I am not quite sure the curly brackets are needed. And nowhere else in
> qca8k.c is this convention being used.

Good point; force of habit from coding standards elsewhere. Fixed (and
also the instance below).

> > +   qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, ETH_FRAME_LEN + ETH_FCS_LEN);
> > +
> > /* Flush the FDB table */
> > qca8k_fdb_flush(priv);
> >  
> > @@ -1098,6 +1104,36 @@ qca8k_port_disable(struct dsa_switch *ds, int port)
> > priv->port_sts[port].enabled = 0;
> >  }
> >  
> > +static int
> > +qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
> > +{
> > +   struct qca8k_priv *priv = ds->priv;
> > +   int i, mtu;
> > +
> > +   if ((new_mtu < ETH_MIN_MTU) || (new_mtu > QCA8K_MAX_MTU)) {
> > +   return -EINVAL;
> > +   }
> 
> I'm pretty sure this check should not be needed.
> The only reason why slave_dev->min_mtu is 0 seems to be:
> 
> commit 8b1efc0f83f1f75b8f85c70d2211007de8fd7633
> Author: Jarod Wilson 
> Date:   Thu Oct 20 23:25:27 2016 -0400
> 
> net: remove MTU limits on a few ether_setup callers
> 
> These few drivers call ether_setup(), but have no ndo_change_mtu, and thus
> were overlooked for changes to MTU range checking behavior. They
> previously had no range checks, so for feature-parity, set their min_mtu
> to 0 and max_mtu to ETH_MAX_MTU (65535), instead of the 68 and 1500
> inherited from the ether_setup() changes. Fine-tuning can come after we 
> get
> back to full feature-parity here.
> 
> CC: net...@vger.kernel.org
> Reported-by: Asbjoern Sloth Toennesen 
> CC: Asbjoern Sloth Toennesen 
> CC: R Parameswaran 
> Signed-off-by: Jarod Wilson 
> Signed-off-by: David S. Miller 
> 
> which is an oversight on my part. Since now DSA supports
> ndo_change_mtu(), the "slave_dev->min_mtu = 0;" line in net/dsa/slave.c
> can be removed and so can this check.

Ok.

> > +
> > +   priv->port_mtu[port] = new_mtu;
> > +
> > +   mtu = 0;
> 
> I think it's more typical to initialize mtu to 0 at declaration time.

Sure, fixed.

> > +   for (i = 0; i < QCA8K_NUM_PORTS; i++) {
> > +   if (priv->port_mtu[port] > mtu)
> > +   mtu = priv->port_mtu[port];
> > +   }
> 
> Again, curly brackets are not needed here, although some might feel it
> aids readability.
> 
> > +
> > +   /* Include L2 header / FCS length */
> > +   qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, mtu + ETH_HLEN + ETH_FCS_LEN);
> > +
> > +   return 0;
> > +}
> > +
> > +static int
> > +qca8k_port_max_mtu(struct dsa_switch *ds, int port)
> > +{
> > +   return QCA8K_MAX_MTU;
> 
> So what is the maximum value that you can write into
> QCA8K_MAX_FRAME_SIZE? 9000 or 9018? If it's 9000, you should report a
> max MTU of 8982, and let the network stack do the range check for you,
> that's why this callback exists in the first place.

9018 (including header + fcs), hence returning QCA8K_MAX_MTU here.

> Do you know how are VLAN tags accounted for (i.e. does iperf3 TCP work
> over a VLAN sub-interface after your patch)? There are 2 options:
> - The ports automatically increase the maximum accepted frame size by 4
>   (or 8, in case of double tag) bytes if they see VLAN tagged traffic.
>   Case in which you don't need to do anything.
> - You need to manually account for the possibility that VLAN-tagged
>   traffic will be received, since the 802.1Q header is not part of the
>   SDU whose max length is measured by the MTU. So you might want to
>   write a value to QCA8K_MAX_FRAME_SIZE that is either "mtu +
>   VLAN_ETH_HLEN + ETH_FCS_LEN", or "mtu + ETH_HLEN + 2 * VLAN_HLEN +
>   ETH_FCS_LEN", depending on whether you foresee double-tagging being
>   used.

The value is for a normal packet; the switch accounts for VLAN / double
VLAN / the switch tagging header size itself.

> > +}
> > +
> >  static int
> >  qca8k_port_fdb_insert(struct qca8k_priv *priv, const u8 *addr,
> >   u16 port_mask, u16 vid)
> > @@ -1174,6 +1210,8 @@ static const struct dsa_switch_ops qca8k_switch_ops = 
> > {
> > .set_mac_eee   

[PATCH] ASoC: fsl: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.


 sound/soc/fsl/imx-audmix.c | 4 ++--
 sound/soc/fsl/imx-audmux.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/fsl/imx-audmix.c b/sound/soc/fsl/imx-audmix.c
index e09b45de0efd..96980cb0497f 100644
--- a/sound/soc/fsl/imx-audmix.c
+++ b/sound/soc/fsl/imx-audmix.c
@@ -6,8 +6,8 @@
  * License. You may obtain a copy of the GNU General Public License
  * Version 2 or later at the following locations:
  *
- * http://www.opensource.org/licenses/gpl-license.html
- * http://www.gnu.org/copyleft/gpl.html
+ * https://www.opensource.org/licenses/gpl-license.html
+ * https://www.gnu.org/copyleft/gpl.html
  */
 
 #include 
diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
index 3ce85a43e08f..25c18b9e348f 100644
--- a/sound/soc/fsl/imx-audmux.c
+++ b/sound/soc/fsl/imx-audmux.c
@@ -5,7 +5,7 @@
 // Copyright 2009 Pengutronix, Sascha Hauer 
 //
 // Initial development of this code was funded by
-// Phytec Messtechnik GmbH, http://www.phytec.de
+// Phytec Messtechnik GmbH, https://www.phytec.de
 
 #include 
 #include 
-- 
2.27.0



[PATCH] ASoC: ti: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.


 sound/soc/ti/udma-pcm.c | 2 +-
 sound/soc/ti/udma-pcm.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/ti/udma-pcm.c b/sound/soc/ti/udma-pcm.c
index 39830caaaf7c..2ff0f518aba5 100644
--- a/sound/soc/ti/udma-pcm.c
+++ b/sound/soc/ti/udma-pcm.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- *  Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com
+ *  Copyright (C) 2020 Texas Instruments Incorporated - https://www.ti.com
  *  Author: Peter Ujfalusi 
  */
 
diff --git a/sound/soc/ti/udma-pcm.h b/sound/soc/ti/udma-pcm.h
index 54111e7312c1..9ed588fd79b9 100644
--- a/sound/soc/ti/udma-pcm.h
+++ b/sound/soc/ti/udma-pcm.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- *  Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com
+ *  Copyright (C) 2018 Texas Instruments Incorporated - https://www.ti.com
  */
 
 #ifndef __UDMA_PCM_H__
-- 
2.27.0



Re: [PATCH v6 2/4] drm/imx: Add initial support for DCSS on iMX8MQ

2020-07-18 Thread Guido Günther
Hi,
On Fri, Jul 17, 2020 at 09:48:49PM +0200, Sam Ravnborg wrote:
> Hi Laurentiu.
> 
> On Fri, Jul 17, 2020 at 05:41:27PM +0300, Laurentiu Palcu wrote:
> > From: Laurentiu Palcu 
> > 
> > This adds initial support for iMX8MQ's Display Controller Subsystem (DCSS).
> > Some of its capabilities include:
> >  * 4K@60fps;
> >  * HDR10;
> >  * one graphics and 2 video pipelines;
> >  * on-the-fly decompression of compressed video and graphics;
> > 
> > The reference manual can be found here:
> > https://www.nxp.com/webapp/Download?colCode=IMX8MDQLQRM
> > 
> > The current patch adds only basic functionality: one primary plane for
> > graphics, linear, tiled and super-tiled buffers support (no graphics
> > decompression yet), no HDR10 and no video planes.
> > 
> > Video planes support and HDR10 will be added in subsequent patches once
> > per-plane de-gamma/CSC/gamma support is in.
> > 
> > Signed-off-by: Laurentiu Palcu 
> > Reviewed-by: Lucas Stach 
> > ---
> 
> 
> return drm_bridge_attach(encoder, bridge, NULL, 0);
> 
> 
> The above code-snippet tells that the display-driver rely on the bridge
> to create the connector.
> Could this by any chance be updated to the new way where the display
> driver creates the connector - and thus passing DRM_BRIDGE_ATTACH_NO_CONNECTOR
> as the flags argument?
> 
> What bridges would be relevant?
> To check that the reelvant bridges are already ported.

I think that's mostly NWL atm since MHDP isn't mainline yet. Can you
recommend a bridge driver to look at that does this right?
Cheers,
 -- Guido


[PATCH] net/fealnx: switch from 'pci_' to 'dma_' API

2020-07-18 Thread Christophe JAILLET
The wrappers in include/linux/pci-dma-compat.h should go away.

The patch has been generated with the coccinelle script below and has been
hand modified to replace GFP_ with a correct flag.
It has been compile tested.

When memory is allocated, GFP_KERNEL can be used because it is called from
the probe function (i.e. 'fealnx_init_one()') and no lock is taken.

@@
@@
-PCI_DMA_BIDIRECTIONAL
+DMA_BIDIRECTIONAL

@@
@@
-PCI_DMA_TODEVICE
+DMA_TO_DEVICE

@@
@@
-PCI_DMA_FROMDEVICE
+DMA_FROM_DEVICE

@@
@@
-PCI_DMA_NONE
+DMA_NONE

@@
expression e1, e2, e3;
@@
-pci_alloc_consistent(e1, e2, e3)
+dma_alloc_coherent(>dev, e2, e3, GFP_)

@@
expression e1, e2, e3;
@@
-pci_zalloc_consistent(e1, e2, e3)
+dma_alloc_coherent(>dev, e2, e3, GFP_)

@@
expression e1, e2, e3, e4;
@@
-pci_free_consistent(e1, e2, e3, e4)
+dma_free_coherent(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_map_single(e1, e2, e3, e4)
+dma_map_single(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_unmap_single(e1, e2, e3, e4)
+dma_unmap_single(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4, e5;
@@
-pci_map_page(e1, e2, e3, e4, e5)
+dma_map_page(>dev, e2, e3, e4, e5)

@@
expression e1, e2, e3, e4;
@@
-pci_unmap_page(e1, e2, e3, e4)
+dma_unmap_page(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_map_sg(e1, e2, e3, e4)
+dma_map_sg(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_unmap_sg(e1, e2, e3, e4)
+dma_unmap_sg(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+dma_sync_single_for_cpu(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_dma_sync_single_for_device(e1, e2, e3, e4)
+dma_sync_single_for_device(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+dma_sync_sg_for_cpu(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+dma_sync_sg_for_device(>dev, e2, e3, e4)

@@
expression e1, e2;
@@
-pci_dma_mapping_error(e1, e2)
+dma_mapping_error(>dev, e2)

@@
expression e1, e2;
@@
-pci_set_dma_mask(e1, e2)
+dma_set_mask(>dev, e2)

@@
expression e1, e2;
@@
-pci_set_consistent_dma_mask(e1, e2)
+dma_set_coherent_mask(>dev, e2)

Signed-off-by: Christophe JAILLET 
---
If needed, see post from Christoph Hellwig on the kernel-janitors ML:
   https://marc.info/?l=kernel-janitors=158745678307186=4
---
 drivers/net/ethernet/fealnx.c | 91 ---
 1 file changed, 53 insertions(+), 38 deletions(-)

diff --git a/drivers/net/ethernet/fealnx.c b/drivers/net/ethernet/fealnx.c
index 73e896a7d8fd..c696651dd735 100644
--- a/drivers/net/ethernet/fealnx.c
+++ b/drivers/net/ethernet/fealnx.c
@@ -543,7 +543,8 @@ static int fealnx_init_one(struct pci_dev *pdev,
np->mii.phy_id_mask = 0x1f;
np->mii.reg_num_mask = 0x1f;
 
-   ring_space = pci_alloc_consistent(pdev, RX_TOTAL_SIZE, _dma);
+   ring_space = dma_alloc_coherent(>dev, RX_TOTAL_SIZE, _dma,
+   GFP_KERNEL);
if (!ring_space) {
err = -ENOMEM;
goto err_out_free_dev;
@@ -551,7 +552,8 @@ static int fealnx_init_one(struct pci_dev *pdev,
np->rx_ring = ring_space;
np->rx_ring_dma = ring_dma;
 
-   ring_space = pci_alloc_consistent(pdev, TX_TOTAL_SIZE, _dma);
+   ring_space = dma_alloc_coherent(>dev, TX_TOTAL_SIZE, _dma,
+   GFP_KERNEL);
if (!ring_space) {
err = -ENOMEM;
goto err_out_free_rx;
@@ -656,9 +658,11 @@ static int fealnx_init_one(struct pci_dev *pdev,
return 0;
 
 err_out_free_tx:
-   pci_free_consistent(pdev, TX_TOTAL_SIZE, np->tx_ring, np->tx_ring_dma);
+   dma_free_coherent(>dev, TX_TOTAL_SIZE, np->tx_ring,
+ np->tx_ring_dma);
 err_out_free_rx:
-   pci_free_consistent(pdev, RX_TOTAL_SIZE, np->rx_ring, np->rx_ring_dma);
+   dma_free_coherent(>dev, RX_TOTAL_SIZE, np->rx_ring,
+ np->rx_ring_dma);
 err_out_free_dev:
free_netdev(dev);
 err_out_unmap:
@@ -676,10 +680,10 @@ static void fealnx_remove_one(struct pci_dev *pdev)
if (dev) {
struct netdev_private *np = netdev_priv(dev);
 
-   pci_free_consistent(pdev, TX_TOTAL_SIZE, np->tx_ring,
-   np->tx_ring_dma);
-   pci_free_consistent(pdev, RX_TOTAL_SIZE, np->rx_ring,
-   np->rx_ring_dma);
+   dma_free_coherent(>dev, TX_TOTAL_SIZE, np->tx_ring,
+ np->tx_ring_dma);
+   dma_free_coherent(>dev, RX_TOTAL_SIZE, np->rx_ring,
+ np->rx_ring_dma);
unregister_netdev(dev);
pci_iounmap(pdev, np->mem);
free_netdev(dev);
@@ -1056,8 

Re: [PATCH] ceph: ceph_features.h: drop duplicated word in a comment

2020-07-18 Thread Jeff Layton
On Fri, 2020-07-17 at 16:36 -0700, Randy Dunlap wrote:
> From: Randy Dunlap 
> 
> Drop the doubled word "the" in a comment.
> 
> Signed-off-by: Randy Dunlap 
> Cc: Ilya Dryomov 
> Cc: Jeff Layton 
> Cc: ceph-de...@vger.kernel.org
> ---
>  include/linux/ceph/ceph_features.h |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-next-20200714.orig/include/linux/ceph/ceph_features.h
> +++ linux-next-20200714/include/linux/ceph/ceph_features.h
> @@ -58,7 +58,7 @@
>   *because 10.2.z (jewel) did not care if its peers advertised this
>   *feature bit.
>   *
> - *  - In the second phase we stop advertising the the bit and call it
> + *  - In the second phase we stop advertising the bit and call it
>   *RETIRED.  This can normally be done in the *next* major release
>   *following the one in which we marked the feature DEPRECATED.  In
>   *the above example, for 12.0.z (luminous) we can say:
> 

Merged into the testing branch. Thanks, Randy!
-- 
Jeff Layton 



[PATCH] firmware: ti_sci: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.


 .../devicetree/bindings/interrupt-controller/ti,sci-intr.txt| 2 +-
 drivers/firmware/ti_sci.c   | 2 +-
 drivers/firmware/ti_sci.h   | 2 +-
 drivers/irqchip/irq-ti-sci-inta.c   | 2 +-
 drivers/irqchip/irq-ti-sci-intr.c   | 2 +-
 drivers/reset/reset-ti-sci.c| 2 +-
 include/linux/soc/ti/ti_sci_inta_msi.h  | 2 +-
 include/linux/soc/ti/ti_sci_protocol.h  | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/interrupt-controller/ti,sci-intr.txt 
b/Documentation/devicetree/bindings/interrupt-controller/ti,sci-intr.txt
index 1a8718f8855d..178fca08278f 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/ti,sci-intr.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/ti,sci-intr.txt
@@ -55,7 +55,7 @@ Required Properties:
corresponds to a range of host irqs.
 
 For more details on TISCI IRQ resource management refer:
-http://downloads.ti.com/tisci/esd/latest/2_tisci_msgs/rm/rm_irq.html
+https://downloads.ti.com/tisci/esd/latest/2_tisci_msgs/rm/rm_irq.html
 
 Example:
 
diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 4126be9e3216..53cee17d0115 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -2,7 +2,7 @@
 /*
  * Texas Instruments System Control Interface Protocol Driver
  *
- * Copyright (C) 2015-2016 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2015-2016 Texas Instruments Incorporated - https://www.ti.com/
  * Nishanth Menon
  */
 
diff --git a/drivers/firmware/ti_sci.h b/drivers/firmware/ti_sci.h
index f0d068c03944..57cd04062994 100644
--- a/drivers/firmware/ti_sci.h
+++ b/drivers/firmware/ti_sci.h
@@ -6,7 +6,7 @@
  * The system works in a message response protocol
  * See: http://processors.wiki.ti.com/index.php/TISCI for details
  *
- * Copyright (C)  2015-2016 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C)  2015-2016 Texas Instruments Incorporated - 
https://www.ti.com/
  */
 
 #ifndef __TI_SCI_H
diff --git a/drivers/irqchip/irq-ti-sci-inta.c 
b/drivers/irqchip/irq-ti-sci-inta.c
index 7e3ebf6ed2cd..85de19fe9b6e 100644
--- a/drivers/irqchip/irq-ti-sci-inta.c
+++ b/drivers/irqchip/irq-ti-sci-inta.c
@@ -2,7 +2,7 @@
 /*
  * Texas Instruments' K3 Interrupt Aggregator irqchip driver
  *
- * Copyright (C) 2018-2019 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2018-2019 Texas Instruments Incorporated - https://www.ti.com/
  * Lokesh Vutla 
  */
 
diff --git a/drivers/irqchip/irq-ti-sci-intr.c 
b/drivers/irqchip/irq-ti-sci-intr.c
index 59d51a20bbd8..5ea148faf2ab 100644
--- a/drivers/irqchip/irq-ti-sci-intr.c
+++ b/drivers/irqchip/irq-ti-sci-intr.c
@@ -2,7 +2,7 @@
 /*
  * Texas Instruments' K3 Interrupt Router irqchip driver
  *
- * Copyright (C) 2018-2019 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2018-2019 Texas Instruments Incorporated - https://www.ti.com/
  * Lokesh Vutla 
  */
 
diff --git a/drivers/reset/reset-ti-sci.c b/drivers/reset/reset-ti-sci.c
index bf68729ab729..b799aefad547 100644
--- a/drivers/reset/reset-ti-sci.c
+++ b/drivers/reset/reset-ti-sci.c
@@ -1,7 +1,7 @@
 /*
  * Texas Instrument's System Control Interface (TI-SCI) reset driver
  *
- * Copyright (C) 2015-2017 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2015-2017 Texas Instruments Incorporated - https://www.ti.com/
  * Andrew F. Davis 
  *
  * This program is free software; you can redistribute it and/or modify
diff --git a/include/linux/soc/ti/ti_sci_inta_msi.h 
b/include/linux/soc/ti/ti_sci_inta_msi.h
index 11fb5048f5f6..e3aa8b14612e 100644
--- a/include/linux/soc/ti/ti_sci_inta_msi.h
+++ b/include/linux/soc/ti/ti_sci_inta_msi.h
@@ -2,7 +2,7 @@
 /*
  * Texas 

[PATCH v2 2/3] dt-bindings: arm: rockchip: add Zkmagic A95X Z2 description

2020-07-18 Thread Johan Jonker
Add Zkmagic A95X Z2 description for a board with rk3318 processor.

Signed-off-by: Johan Jonker 
---
 Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/arm/rockchip.yaml 
b/Documentation/devicetree/bindings/arm/rockchip.yaml
index d4a404509..441fe82d2 100644
--- a/Documentation/devicetree/bindings/arm/rockchip.yaml
+++ b/Documentation/devicetree/bindings/arm/rockchip.yaml
@@ -549,4 +549,9 @@ properties:
 items:
   - const: tronsmart,orion-r68-meta
   - const: rockchip,rk3368
+
+  - description: Zkmagic A95X Z2
+items:
+  - const: zkmagic,a95x-z2
+  - const: rockchip,rk3318
 ...
-- 
2.11.0



[PATCH v2 1/3] dt-bindings: Add vendor prefix for Shenzhen Zkmagic Technology Co., Ltd.

2020-07-18 Thread Johan Jonker
Add vendor prefix for Shenzhen Zkmagic Technology Co., Ltd.

Signed-off-by: Johan Jonker 
---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml 
b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 9aeab66be..5ab3d7c93 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -1181,6 +1181,8 @@ patternProperties:
 description: Shenzhen Zidoo Technology Co., Ltd.
   "^zii,.*":
 description: Zodiac Inflight Innovations
+  "^zkmagic,.*":
+description: Shenzhen Zkmagic Technology Co., Ltd.
   "^zte,.*":
 description: ZTE Corp.
   "^zyxel,.*":
-- 
2.11.0



[PATCH v2 3/3] arm64: dts: rockchip: add rk3318 A95X Z2 board

2020-07-18 Thread Johan Jonker
The rk3318 A95X Z2 boards are sold as TV box.
No further documentation is given, but from the dts files
extracted it seems that the rk3318 processor is simulair
to the rk3328. This dts file contains only the basic nodes
that have support in the mainline kernel.

Features:

CPU: RK3318 Quad-Core Cortex-A53
GPU: Mali-450
RAM: 2/4GB DDR3
ROM: EMMC 16/32/64GB
HDMI: HDMI 2.0a for 4k@60Hz
Ethernet: 10/100M standard RJ-45
WiFi: 2.4G+5G WIFI, 802.11 b/g/n
Bluetooth: 4.0
1 x USB 3.0
1 x USB 2.0
1 x Micro SD card slot
1 x SPDIF
1 x AV
1 x DC IN

Signed-off-by: Johan Jonker 
---
 arch/arm64/boot/dts/rockchip/Makefile   |   1 +
 arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts | 393 
 2 files changed, 394 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts

diff --git a/arch/arm64/boot/dts/rockchip/Makefile 
b/arch/arm64/boot/dts/rockchip/Makefile
index b87b1f773..aa508bc4a 100644
--- a/arch/arm64/boot/dts/rockchip/Makefile
+++ b/arch/arm64/boot/dts/rockchip/Makefile
@@ -2,6 +2,7 @@
 dtb-$(CONFIG_ARCH_ROCKCHIP) += px30-evb.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-evb.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3308-roc-cc.dtb
+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3318-a95x-z2.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3326-odroid-go2.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-a1.dtb
 dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-evb.dtb
diff --git a/arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts 
b/arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts
new file mode 100644
index 0..413418ea1
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts
@@ -0,0 +1,393 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/dts-v1/;
+#include 
+#include "rk3328.dtsi"
+
+/ {
+   model = "A95X Z2";
+   compatible = "zkmagic,a95x-z2", "rockchip,rk3318";
+
+   chosen {
+   stdout-path = "serial2:150n8";
+   };
+
+   adc-keys {
+   compatible = "adc-keys";
+   io-channels = < 0>;
+   io-channel-names = "buttons";
+   keyup-threshold-microvolt = <180>;
+   poll-interval = <100>;
+
+   vol-up-key {
+   label = "volume up";
+   linux,code = ;
+   press-threshold-microvolt = <17000>;
+   };
+   };
+
+   ir-receiver {
+   compatible = "gpio-ir-receiver";
+   gpios = < RK_PA2 GPIO_ACTIVE_LOW>;
+   pinctrl-0 = <_int>;
+   pinctrl-names = "default";
+   };
+
+   leds {
+   compatible = "gpio-leds";
+   pinctrl-0 = <_led_pin>;
+   pinctrl-names = "default";
+
+   cyx_led: led-0 {
+   default-state = "on";
+   gpios = < RK_PC7 GPIO_ACTIVE_LOW>;
+   label = "CYX_LED";
+   };
+   };
+
+   sdio_pwrseq: sdio-pwrseq {
+   compatible = "mmc-pwrseq-simple";
+   pinctrl-0 = <_enable_h>;
+   pinctrl-names = "default";
+   reset-gpios = < RK_PC2 GPIO_ACTIVE_LOW>;
+   };
+
+   spdif-sound {
+   compatible = "simple-audio-card";
+   simple-audio-card,name = "spdif";
+
+   simple-audio-card,cpu {
+   sound-dai = <>;
+   };
+
+   simple-audio-card,codec {
+   sound-dai = <_out>;
+   };
+   };
+
+   spdif_out: spdif-out {
+   compatible = "linux,spdif-dit";
+   #sound-dai-cells = <0>;
+   };
+
+   /* Power tree */
+   regulators {
+   compatible = "simple-mfd";
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   vccio_1v8_reg: regulator@0 {
+   compatible = "regulator-fixed";
+   reg = <0>;
+   regulator-name = "vccio_1v8";
+   regulator-min-microvolt = <180>;
+   regulator-max-microvolt = <180>;
+   regulator-always-on;
+   };
+
+   vccio_3v3_reg: regulator@1 {
+   compatible = "regulator-fixed";
+   reg = <1>;
+   regulator-name = "vccio_3v3";
+   regulator-min-microvolt = <330>;
+   regulator-max-microvolt = <330>;
+   regulator-always-on;
+   };
+   };
+
+   vcc_otg_vbus: otg-vbus-regulator {
+   compatible = "regulator-fixed";
+   gpio = < RK_PA2 GPIO_ACTIVE_HIGH>;
+   pinctrl-0 = <_vbus_drv>;
+   pinctrl-names = "default";
+   regulator-name = "vcc_otg_vbus";
+   regulator-min-microvolt = <500>;
+   regulator-max-microvolt = <500>;
+   enable-active-high;
+   };
+
+  

[PATCH v2 0/3] rk3318 A95X Z2 board

2020-07-18 Thread Johan Jonker
Add rk3318 A95X Z2 board.

What works:
 adc key
 emmc
 ethernet
 hdmi
 gpu
 ir
 mmc
 sd card
 vop
 usb2
 uart2

Not tested:
 av
 uart0 / bt
 spdif
 wifi

No support in mainline:
 usb3 (works with manufacturer driver)
 front display (works with custom gpio driver AD1628/HT1628)

Problems:
 U-boot only starts on emmc, then loads kernel from sd card or emmc.

 Hdmi hotplug detects DVI modes, but marks them all BAD.
 The dw-hdmi driver needs more pre_pll_cfg_table entries.
 Slow boot behavior. Screen available way after boot. (no penguins)

 GPU support for Debian is not up to date. (old version)
 Use Github version instead.
 Test with glmark2-es2-drm gives glmark2 Score: 29
 Kernel log:
  lima ff30.gpu: pp pp0 reset time out
  lima ff30.gpu: pp pp1 reset time out
 No mainline support for GPU thermal and voltage to frequency.
 PWM1 supply connected to DMC, GPU and vcodec.

 The box only has a model name. Vendor prefix not verified.

 Etc.

Changed V2:
  add vendor prefix
  changed compatible string
  restyle
  removed usb3 regulator node
  changed led active high to active low

Johan Jonker (3):
  dt-bindings: Add vendor prefix for Shenzhen Zkmagic Technology Co.,
Ltd.
  dt-bindings: arm: rockchip: add Zkmagic A95X Z2 description
  arm64: dts: rockchip: add rk3318 A95X Z2 board

 .../devicetree/bindings/arm/rockchip.yaml  |   5 +
 .../devicetree/bindings/vendor-prefixes.yaml   |   2 +
 arch/arm64/boot/dts/rockchip/Makefile  |   1 +
 arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts| 393 +
 4 files changed, 401 insertions(+)
 create mode 100644 arch/arm64/boot/dts/rockchip/rk3318-a95x-z2.dts

--
2.11.0



Re: [PATCH] net: dsa: felix: Make some symbols static

2020-07-18 Thread wanghai (M)

Thanks for reminding me, I'll do it.

在 2020/7/18 18:40, Vladimir Oltean 写道:

On Sat, Jul 18, 2020 at 06:01:58PM +0800, Wang Hai wrote:

Fix sparse build warning:

drivers/net/dsa/ocelot/felix_vsc9959.c:560:19: warning:
  symbol 'vsc9959_vcap_is2_keys' was not declared. Should it be static?
drivers/net/dsa/ocelot/felix_vsc9959.c:640:19: warning:
  symbol 'vsc9959_vcap_is2_actions' was not declared. Should it be static?

Reported-by: Hulk Robot 
Signed-off-by: Wang Hai 
---

Please update your tree.

commit 3ab4ceb6e9639e4e42d473e46ae7976c24187876
Author: Vladimir Oltean 
Date:   Sat Jun 20 18:43:36 2020 +0300

 net: dsa: felix: make vcap is2 keys and actions static

 Get rid of some sparse warnings.

 Signed-off-by: Vladimir Oltean 
 Signed-off-by: David S. Miller 


  drivers/net/dsa/ocelot/felix_vsc9959.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c 
b/drivers/net/dsa/ocelot/felix_vsc9959.c
index 1dd9e348152d..2067776773f7 100644
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
@@ -557,7 +557,7 @@ static const struct ocelot_stat_layout 
vsc9959_stats_layout[] = {
{ .offset = 0x111,  .name = "drop_green_prio_7", },
  };
  
-struct vcap_field vsc9959_vcap_is2_keys[] = {

+static struct vcap_field vsc9959_vcap_is2_keys[] = {
/* Common: 41 bits */
[VCAP_IS2_TYPE] = {  0,   4},
[VCAP_IS2_HK_FIRST] = {  4,   1},
@@ -637,7 +637,7 @@ struct vcap_field vsc9959_vcap_is2_keys[] = {
[VCAP_IS2_HK_OAM_IS_Y1731]  = {182,   1},
  };
  
-struct vcap_field vsc9959_vcap_is2_actions[] = {

+static struct vcap_field vsc9959_vcap_is2_actions[] = {
[VCAP_IS2_ACT_HIT_ME_ONCE]  = {  0,  1},
[VCAP_IS2_ACT_CPU_COPY_ENA] = {  1,  1},
[VCAP_IS2_ACT_CPU_QU_NUM]   = {  2,  3},
--
2.17.1


Thanks,
-Vladimir

.





[PATCH] pinctrl: samsung: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.


 drivers/pinctrl/samsung/pinctrl-exynos-arm.c   | 2 +-
 drivers/pinctrl/samsung/pinctrl-exynos-arm64.c | 2 +-
 drivers/pinctrl/samsung/pinctrl-exynos.c   | 2 +-
 drivers/pinctrl/samsung/pinctrl-exynos.h   | 2 +-
 drivers/pinctrl/samsung/pinctrl-samsung.c  | 2 +-
 drivers/pinctrl/samsung/pinctrl-samsung.h  | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c 
b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c
index 85ddf49a5188..6b3b60157bf9 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c
@@ -5,7 +5,7 @@
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 // http://www.samsung.com
 // Copyright (c) 2012 Linaro Ltd
-// http://www.linaro.org
+// https://www.linaro.org
 //
 // Author: Thomas Abraham 
 //
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c 
b/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c
index b6e56422a700..d96ae32bb66d 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c
@@ -6,7 +6,7 @@
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 // http://www.samsung.com
 // Copyright (c) 2012 Linaro Ltd
-// http://www.linaro.org
+// https://www.linaro.org
 // Copyright (c) 2017 Krzysztof Kozlowski 
 //
 // This file contains the Samsung Exynos specific information required by the
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c 
b/drivers/pinctrl/samsung/pinctrl-exynos.c
index 84501c785473..72752cb51771 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos.c
@@ -5,7 +5,7 @@
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 // http://www.samsung.com
 // Copyright (c) 2012 Linaro Ltd
-// http://www.linaro.org
+// https://www.linaro.org
 //
 // Author: Thomas Abraham 
 //
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.h 
b/drivers/pinctrl/samsung/pinctrl-exynos.h
index da1ec13697e7..aad7b69f1287 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos.h
+++ b/drivers/pinctrl/samsung/pinctrl-exynos.h
@@ -5,7 +5,7 @@
  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
  * http://www.samsung.com
  * Copyright (c) 2012 Linaro Ltd
- * http://www.linaro.org
+ * https://www.linaro.org
  *
  * This file contains the Exynos specific definitions for the Samsung
  * pinctrl/gpiolib interface drivers.
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c 
b/drivers/pinctrl/samsung/pinctrl-samsung.c
index f26574ef234a..9eac799c541e 100644
--- a/drivers/pinctrl/samsung/pinctrl-samsung.c
+++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
@@ -5,7 +5,7 @@
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 // http://www.samsung.com
 // Copyright (c) 2012 Linaro Ltd
-// http://www.linaro.org
+// https://www.linaro.org
 //
 // Author: Thomas Abraham 
 //
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.h 
b/drivers/pinctrl/samsung/pinctrl-samsung.h
index 379f34a9a482..c4c5356d696a 100644
--- a/drivers/pinctrl/samsung/pinctrl-samsung.h
+++ b/drivers/pinctrl/samsung/pinctrl-samsung.h
@@ -5,7 +5,7 @@
  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
  * http://www.samsung.com
  * Copyright (c) 2012 Linaro Ltd
- * http://www.linaro.org
+ * https://www.linaro.org
  *
  * Author: Thomas Abraham 
  */
-- 
2.27.0



[PATCH] powerpc: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.


 Documentation/powerpc/mpc52xx.rst   | 2 +-
 arch/powerpc/crypto/crc32-vpmsum_core.S | 2 +-
 arch/powerpc/include/asm/hydra.h| 2 +-
 drivers/crypto/vmx/aesp8-ppc.pl | 2 +-
 drivers/crypto/vmx/ghashp8-ppc.pl   | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/powerpc/mpc52xx.rst 
b/Documentation/powerpc/mpc52xx.rst
index 8676ac63e077..30260707c3fe 100644
--- a/Documentation/powerpc/mpc52xx.rst
+++ b/Documentation/powerpc/mpc52xx.rst
@@ -2,7 +2,7 @@
 Linux 2.6.x on MPC52xx family
 =
 
-For the latest info, go to http://www.246tNt.com/mpc52xx/
+For the latest info, go to https://www.246tNt.com/mpc52xx/
 
 To compile/use :
 
diff --git a/arch/powerpc/crypto/crc32-vpmsum_core.S 
b/arch/powerpc/crypto/crc32-vpmsum_core.S
index c3524eba4d0d..a16a717c809c 100644
--- a/arch/powerpc/crypto/crc32-vpmsum_core.S
+++ b/arch/powerpc/crypto/crc32-vpmsum_core.S
@@ -19,7 +19,7 @@
  * We then use fixed point Barrett reduction to compute a mod n over GF(2)
  * for n = CRC using POWER8 instructions. We use x = 32.
  *
- * http://en.wikipedia.org/wiki/Barrett_reduction
+ * https://en.wikipedia.org/wiki/Barrett_reduction
  *
  * Copyright (C) 2015 Anton Blanchard , IBM
 */
diff --git a/arch/powerpc/include/asm/hydra.h b/arch/powerpc/include/asm/hydra.h
index b3b0f2d020f0..ae02eb53d6ef 100644
--- a/arch/powerpc/include/asm/hydra.h
+++ b/arch/powerpc/include/asm/hydra.h
@@ -10,7 +10,7 @@
  *
  * © Copyright 1995 Apple Computer, Inc. All rights reserved.
  *
- *  It's available online from http://www.cpu.lu/~mlan/ftp/MacTech.pdf
+ *  It's available online from https://www.cpu.lu/~mlan/ftp/MacTech.pdf
  *  You can obtain paper copies of this book from computer bookstores or by
  *  writing Morgan Kaufmann Publishers, Inc., 340 Pine Street, Sixth Floor, San
  *  Francisco, CA 94104. Reference ISBN 1-55860-393-X.
diff --git a/drivers/crypto/vmx/aesp8-ppc.pl b/drivers/crypto/vmx/aesp8-ppc.pl
index db874367b602..50a0a18f35da 100644
--- a/drivers/crypto/vmx/aesp8-ppc.pl
+++ b/drivers/crypto/vmx/aesp8-ppc.pl
@@ -50,7 +50,7 @@
 # Written by Andy Polyakov  for the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://www.openssl.org/~appro/cryptogams/.
 # 
 #
 # This module implements support for AES instructions as per PowerISA
diff --git a/drivers/crypto/vmx/ghashp8-ppc.pl 
b/drivers/crypto/vmx/ghashp8-ppc.pl
index 38b06503ede0..09bba1852eec 100644
--- a/drivers/crypto/vmx/ghashp8-ppc.pl
+++ b/drivers/crypto/vmx/ghashp8-ppc.pl
@@ -13,7 +13,7 @@
 # Written by Andy Polyakov  for the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
-# details see http://www.openssl.org/~appro/cryptogams/.
+# details see https://www.openssl.org/~appro/cryptogams/.
 # 
 #
 # GHASH for for PowerISA v2.07.
-- 
2.27.0



Re: [PATCH] net: dsa: felix: Make some symbols static

2020-07-18 Thread Vladimir Oltean
On Sat, Jul 18, 2020 at 06:01:58PM +0800, Wang Hai wrote:
> Fix sparse build warning:
> 
> drivers/net/dsa/ocelot/felix_vsc9959.c:560:19: warning:
>  symbol 'vsc9959_vcap_is2_keys' was not declared. Should it be static?
> drivers/net/dsa/ocelot/felix_vsc9959.c:640:19: warning:
>  symbol 'vsc9959_vcap_is2_actions' was not declared. Should it be static?
> 
> Reported-by: Hulk Robot 
> Signed-off-by: Wang Hai 
> ---

Please update your tree.

commit 3ab4ceb6e9639e4e42d473e46ae7976c24187876
Author: Vladimir Oltean 
Date:   Sat Jun 20 18:43:36 2020 +0300

net: dsa: felix: make vcap is2 keys and actions static

Get rid of some sparse warnings.

Signed-off-by: Vladimir Oltean 
Signed-off-by: David S. Miller 

>  drivers/net/dsa/ocelot/felix_vsc9959.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c 
> b/drivers/net/dsa/ocelot/felix_vsc9959.c
> index 1dd9e348152d..2067776773f7 100644
> --- a/drivers/net/dsa/ocelot/felix_vsc9959.c
> +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
> @@ -557,7 +557,7 @@ static const struct ocelot_stat_layout 
> vsc9959_stats_layout[] = {
>   { .offset = 0x111,  .name = "drop_green_prio_7", },
>  };
>  
> -struct vcap_field vsc9959_vcap_is2_keys[] = {
> +static struct vcap_field vsc9959_vcap_is2_keys[] = {
>   /* Common: 41 bits */
>   [VCAP_IS2_TYPE] = {  0,   4},
>   [VCAP_IS2_HK_FIRST] = {  4,   1},
> @@ -637,7 +637,7 @@ struct vcap_field vsc9959_vcap_is2_keys[] = {
>   [VCAP_IS2_HK_OAM_IS_Y1731]  = {182,   1},
>  };
>  
> -struct vcap_field vsc9959_vcap_is2_actions[] = {
> +static struct vcap_field vsc9959_vcap_is2_actions[] = {
>   [VCAP_IS2_ACT_HIT_ME_ONCE]  = {  0,  1},
>   [VCAP_IS2_ACT_CPU_COPY_ENA] = {  1,  1},
>   [VCAP_IS2_ACT_CPU_QU_NUM]   = {  2,  3},
> -- 
> 2.17.1
> 

Thanks,
-Vladimir


Re: [PATCH] HID: udraw-ps3: Replace HTTP links with HTTPS ones

2020-07-18 Thread Bastien Nocera
On Sat, 2020-07-18 at 12:33 +0200, Alexander A. Klimov wrote:
> Rationale:
> Reduces attack surface on kernel devs opening the links for MITM
> as HTTPS traffic is much harder to manipulate.
> 
> Deterministic algorithm:
> For each file:
>   If not .svg:
> For each line:
>   If doesn't contain `\bxmlns\b`:
> For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
> If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
> If both the HTTP and HTTPS versions
> return 200 OK and serve the same content:
>   Replace HTTP with HTTPS.
> 
> Signed-off-by: Alexander A. Klimov 

Looks good!

Acked-by: Bastien Nocera 



Re: [PATCH] net: dsa: qca8k: implement the port MTU callbacks

2020-07-18 Thread Vladimir Oltean
On Sat, Jul 18, 2020 at 10:35:55AM +0100, Jonathan McDowell wrote:
> This switch has a single max frame size configuration register, so we
> track the requested MTU for each port and apply the largest.
> 
> Signed-off-by: Jonathan McDowell 
> ---
>  drivers/net/dsa/qca8k.c | 38 ++
>  drivers/net/dsa/qca8k.h |  3 +++
>  2 files changed, 41 insertions(+)
> 
> diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
> index 4acad5fa0c84..3690f02aea3a 100644
> --- a/drivers/net/dsa/qca8k.c
> +++ b/drivers/net/dsa/qca8k.c
> @@ -670,6 +670,12 @@ qca8k_setup(struct dsa_switch *ds)
>   }
>   }
>  
> + /* Setup our port MTUs to match power on defaults */
> + for (i = 0; i < QCA8K_NUM_PORTS; i++) {
> + priv->port_mtu[i] = ETH_FRAME_LEN + ETH_FCS_LEN;
> + }

I am not quite sure the curly brackets are needed. And nowhere else in
qca8k.c is this convention being used.

> + qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, ETH_FRAME_LEN + ETH_FCS_LEN);
> +
>   /* Flush the FDB table */
>   qca8k_fdb_flush(priv);
>  
> @@ -1098,6 +1104,36 @@ qca8k_port_disable(struct dsa_switch *ds, int port)
>   priv->port_sts[port].enabled = 0;
>  }
>  
> +static int
> +qca8k_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
> +{
> + struct qca8k_priv *priv = ds->priv;
> + int i, mtu;
> +
> + if ((new_mtu < ETH_MIN_MTU) || (new_mtu > QCA8K_MAX_MTU)) {
> + return -EINVAL;
> + }

I'm pretty sure this check should not be needed.
The only reason why slave_dev->min_mtu is 0 seems to be:

commit 8b1efc0f83f1f75b8f85c70d2211007de8fd7633
Author: Jarod Wilson 
Date:   Thu Oct 20 23:25:27 2016 -0400

net: remove MTU limits on a few ether_setup callers

These few drivers call ether_setup(), but have no ndo_change_mtu, and thus
were overlooked for changes to MTU range checking behavior. They
previously had no range checks, so for feature-parity, set their min_mtu
to 0 and max_mtu to ETH_MAX_MTU (65535), instead of the 68 and 1500
inherited from the ether_setup() changes. Fine-tuning can come after we get
back to full feature-parity here.

CC: net...@vger.kernel.org
Reported-by: Asbjoern Sloth Toennesen 
CC: Asbjoern Sloth Toennesen 
CC: R Parameswaran 
Signed-off-by: Jarod Wilson 
Signed-off-by: David S. Miller 

which is an oversight on my part. Since now DSA supports
ndo_change_mtu(), the "slave_dev->min_mtu = 0;" line in net/dsa/slave.c
can be removed and so can this check.

> +
> + priv->port_mtu[port] = new_mtu;
> +
> + mtu = 0;

I think it's more typical to initialize mtu to 0 at declaration time.

> + for (i = 0; i < QCA8K_NUM_PORTS; i++) {
> + if (priv->port_mtu[port] > mtu)
> + mtu = priv->port_mtu[port];
> + }

Again, curly brackets are not needed here, although some might feel it
aids readability.

> +
> + /* Include L2 header / FCS length */
> + qca8k_write(priv, QCA8K_MAX_FRAME_SIZE, mtu + ETH_HLEN + ETH_FCS_LEN);
> +
> + return 0;
> +}
> +
> +static int
> +qca8k_port_max_mtu(struct dsa_switch *ds, int port)
> +{
> + return QCA8K_MAX_MTU;

So what is the maximum value that you can write into
QCA8K_MAX_FRAME_SIZE? 9000 or 9018? If it's 9000, you should report a
max MTU of 8982, and let the network stack do the range check for you,
that's why this callback exists in the first place.

Do you know how are VLAN tags accounted for (i.e. does iperf3 TCP work
over a VLAN sub-interface after your patch)? There are 2 options:
- The ports automatically increase the maximum accepted frame size by 4
  (or 8, in case of double tag) bytes if they see VLAN tagged traffic.
  Case in which you don't need to do anything.
- You need to manually account for the possibility that VLAN-tagged
  traffic will be received, since the 802.1Q header is not part of the
  SDU whose max length is measured by the MTU. So you might want to
  write a value to QCA8K_MAX_FRAME_SIZE that is either "mtu +
  VLAN_ETH_HLEN + ETH_FCS_LEN", or "mtu + ETH_HLEN + 2 * VLAN_HLEN +
  ETH_FCS_LEN", depending on whether you foresee double-tagging being
  used.

> +}
> +
>  static int
>  qca8k_port_fdb_insert(struct qca8k_priv *priv, const u8 *addr,
> u16 port_mask, u16 vid)
> @@ -1174,6 +1210,8 @@ static const struct dsa_switch_ops qca8k_switch_ops = {
>   .set_mac_eee= qca8k_set_mac_eee,
>   .port_enable= qca8k_port_enable,
>   .port_disable   = qca8k_port_disable,
> + .port_change_mtu= qca8k_port_change_mtu,
> + .port_max_mtu   = qca8k_port_max_mtu,
>   .port_stp_state_set = qca8k_port_stp_state_set,
>   .port_bridge_join   = qca8k_port_bridge_join,
>   .port_bridge_leave  = qca8k_port_bridge_leave,
> diff --git a/drivers/net/dsa/qca8k.h b/drivers/net/dsa/qca8k.h
> index 10ef2bca2cde..31439396401c 100644
> --- 

[tip: x86/urgent] x86/ioperm: Fix io bitmap invalidation on Xen PV

2020-07-18 Thread tip-bot2 for Andy Lutomirski
The following commit has been merged into the x86/urgent branch of tip:

Commit-ID: cadfad870154e14f745ec845708bc17d166065f2
Gitweb:
https://git.kernel.org/tip/cadfad870154e14f745ec845708bc17d166065f2
Author:Andy Lutomirski 
AuthorDate:Fri, 17 Jul 2020 16:53:55 -07:00
Committer: Thomas Gleixner 
CommitterDate: Sat, 18 Jul 2020 12:31:49 +02:00

x86/ioperm: Fix io bitmap invalidation on Xen PV

tss_invalidate_io_bitmap() wasn't wired up properly through the pvop
machinery, so the TSS and Xen's io bitmap would get out of sync
whenever disabling a valid io bitmap.

Add a new pvop for tss_invalidate_io_bitmap() to fix it.

This is XSA-329.

Fixes: 22fe5b0439dd ("x86/ioperm: Move TSS bitmap update to exit to user work")
Signed-off-by: Andy Lutomirski 
Signed-off-by: Thomas Gleixner 
Reviewed-by: Juergen Gross 
Reviewed-by: Thomas Gleixner 
Cc: sta...@vger.kernel.org
Link: 
https://lkml.kernel.org/r/d53075590e1f91c19f8af705059d3ff99424c020.1595030016.git.l...@kernel.org

---
 arch/x86/include/asm/io_bitmap.h  | 16 
 arch/x86/include/asm/paravirt.h   |  5 +
 arch/x86/include/asm/paravirt_types.h |  1 +
 arch/x86/kernel/paravirt.c|  3 ++-
 arch/x86/kernel/process.c | 18 ++
 arch/x86/xen/enlighten_pv.c   | 12 
 6 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/arch/x86/include/asm/io_bitmap.h b/arch/x86/include/asm/io_bitmap.h
index ac1a99f..7f080f5 100644
--- a/arch/x86/include/asm/io_bitmap.h
+++ b/arch/x86/include/asm/io_bitmap.h
@@ -19,12 +19,28 @@ struct task_struct;
 void io_bitmap_share(struct task_struct *tsk);
 void io_bitmap_exit(struct task_struct *tsk);
 
+static inline void native_tss_invalidate_io_bitmap(void)
+{
+   /*
+* Invalidate the I/O bitmap by moving io_bitmap_base outside the
+* TSS limit so any subsequent I/O access from user space will
+* trigger a #GP.
+*
+* This is correct even when VMEXIT rewrites the TSS limit
+* to 0x67 as the only requirement is that the base points
+* outside the limit.
+*/
+   this_cpu_write(cpu_tss_rw.x86_tss.io_bitmap_base,
+  IO_BITMAP_OFFSET_INVALID);
+}
+
 void native_tss_update_io_bitmap(void);
 
 #ifdef CONFIG_PARAVIRT_XXL
 #include 
 #else
 #define tss_update_io_bitmap native_tss_update_io_bitmap
+#define tss_invalidate_io_bitmap native_tss_invalidate_io_bitmap
 #endif
 
 #else
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index 5ca5d29..3d2afec 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -302,6 +302,11 @@ static inline void write_idt_entry(gate_desc *dt, int 
entry, const gate_desc *g)
 }
 
 #ifdef CONFIG_X86_IOPL_IOPERM
+static inline void tss_invalidate_io_bitmap(void)
+{
+   PVOP_VCALL0(cpu.invalidate_io_bitmap);
+}
+
 static inline void tss_update_io_bitmap(void)
 {
PVOP_VCALL0(cpu.update_io_bitmap);
diff --git a/arch/x86/include/asm/paravirt_types.h 
b/arch/x86/include/asm/paravirt_types.h
index 732f62e..8dfcb25 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -141,6 +141,7 @@ struct pv_cpu_ops {
void (*load_sp0)(unsigned long sp0);
 
 #ifdef CONFIG_X86_IOPL_IOPERM
+   void (*invalidate_io_bitmap)(void);
void (*update_io_bitmap)(void);
 #endif
 
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 674a7d6..de2138b 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -324,7 +324,8 @@ struct paravirt_patch_template pv_ops = {
.cpu.swapgs = native_swapgs,
 
 #ifdef CONFIG_X86_IOPL_IOPERM
-   .cpu.update_io_bitmap   = native_tss_update_io_bitmap,
+   .cpu.invalidate_io_bitmap   = native_tss_invalidate_io_bitmap,
+   .cpu.update_io_bitmap   = native_tss_update_io_bitmap,
 #endif
 
.cpu.start_context_switch   = paravirt_nop,
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index f362ce0..fe67dbd 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -322,20 +322,6 @@ void arch_setup_new_exec(void)
 }
 
 #ifdef CONFIG_X86_IOPL_IOPERM
-static inline void tss_invalidate_io_bitmap(struct tss_struct *tss)
-{
-   /*
-* Invalidate the I/O bitmap by moving io_bitmap_base outside the
-* TSS limit so any subsequent I/O access from user space will
-* trigger a #GP.
-*
-* This is correct even when VMEXIT rewrites the TSS limit
-* to 0x67 as the only requirement is that the base points
-* outside the limit.
-*/
-   tss->x86_tss.io_bitmap_base = IO_BITMAP_OFFSET_INVALID;
-}
-
 static inline void switch_to_bitmap(unsigned long tifp)
 {
/*
@@ -346,7 +332,7 @@ static inline void switch_to_bitmap(unsigned long tifp)
 * user mode.
 */
if (tifp & _TIF_IO_BITMAP)
-  

[PATCH] HID: udraw-ps3: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.


 drivers/hid/hid-udraw-ps3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-udraw-ps3.c b/drivers/hid/hid-udraw-ps3.c
index b0fbd11aa0fc..b2e17ef2ea27 100644
--- a/drivers/hid/hid-udraw-ps3.c
+++ b/drivers/hid/hid-udraw-ps3.c
@@ -16,7 +16,7 @@ MODULE_LICENSE("GPL");
 
 /*
  * Protocol information from:
- * http://brandonw.net/udraw/
+ * https://brandonw.net/udraw/
  * and the source code of:
  * https://.org/contribution/udraw-hid
  */
-- 
2.27.0



[tip:irq/urgent] BUILD SUCCESS baedb87d1b53532f81b4bd0387f83b05d4f7eb9a

2020-07-18 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git  
irq/urgent
branch HEAD: baedb87d1b53532f81b4bd0387f83b05d4f7eb9a  genirq/affinity: Handle 
affinity setting on inactive interrupts correctly

elapsed time: 726m

configs tested: 112
configs skipped: 1

The following configs have been built successfully.
More configs may be tested in the coming days.

arm defconfig
arm  allyesconfig
arm  allmodconfig
arm   allnoconfig
arm64allyesconfig
arm64   defconfig
arm64allmodconfig
arm64 allnoconfig
nds32 allnoconfig
powerpc  ppc64e_defconfig
arm   viper_defconfig
ia64 alldefconfig
sh   se7721_defconfig
arm   corgi_defconfig
shedosk7760_defconfig
mipsomega2p_defconfig
powerpc  storcenter_defconfig
arm   tegra_defconfig
h8300allyesconfig
powerpc linkstation_defconfig
sparc   sparc32_defconfig
arm  badge4_defconfig
powerpc  pmac32_defconfig
riscv  rv32_defconfig
i386  allnoconfig
i386 allyesconfig
i386defconfig
i386  debian-10.3
ia64 allmodconfig
ia64defconfig
ia64  allnoconfig
ia64 allyesconfig
m68k allmodconfig
m68k  allnoconfig
m68k   sun3_defconfig
m68kdefconfig
m68k allyesconfig
nds32   defconfig
csky allyesconfig
cskydefconfig
alpha   defconfig
alphaallyesconfig
nios2   defconfig
nios2allyesconfig
openriscdefconfig
c6x  allyesconfig
c6x   allnoconfig
openrisc allyesconfig
xtensa   allyesconfig
h8300allmodconfig
xtensa  defconfig
arc defconfig
arc  allyesconfig
sh   allmodconfig
shallnoconfig
microblazeallnoconfig
mips allyesconfig
mips  allnoconfig
mips allmodconfig
pariscallnoconfig
parisc  defconfig
parisc   allyesconfig
parisc   allmodconfig
powerpc  allyesconfig
powerpc  rhel-kconfig
powerpc  allmodconfig
powerpc   allnoconfig
powerpc defconfig
i386 randconfig-a001-20200717
i386 randconfig-a005-20200717
i386 randconfig-a002-20200717
i386 randconfig-a006-20200717
i386 randconfig-a003-20200717
i386 randconfig-a004-20200717
x86_64   randconfig-a005-20200717
x86_64   randconfig-a006-20200717
x86_64   randconfig-a002-20200717
x86_64   randconfig-a001-20200717
x86_64   randconfig-a003-20200717
x86_64   randconfig-a004-20200717
x86_64   randconfig-a012-20200716
x86_64   randconfig-a011-20200716
x86_64   randconfig-a016-20200716
x86_64   randconfig-a014-20200716
x86_64   randconfig-a013-20200716
x86_64   randconfig-a015-20200716
i386 randconfig-a016-20200717
i386 randconfig-a011-20200717
i386 randconfig-a015-20200717
i386 randconfig-a012-20200717
i386 randconfig-a013-20200717
i386 randconfig-a014-20200717
riscvallyesconfig
riscv allnoconfig
riscv   defconfig
riscvallmodconfig
s390 allyesconfig
s390  allnoconfig
s390 allmodconfig
s390defconfig
sparc 

[tip:core/debugobjects] BUILD SUCCESS 0f85c4805184765ff35e0079b3241ee8f25d1b2b

2020-07-18 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git  
core/debugobjects
branch HEAD: 0f85c4805184765ff35e0079b3241ee8f25d1b2b  debugobjects: Convert to 
DEFINE_SHOW_ATTRIBUTE

elapsed time: 726m

configs tested: 115
configs skipped: 2

The following configs have been built successfully.
More configs may be tested in the coming days.

arm defconfig
arm  allyesconfig
arm  allmodconfig
arm   allnoconfig
arm64allyesconfig
arm64   defconfig
arm64allmodconfig
arm64 allnoconfig
nds32 allnoconfig
powerpc  ppc64e_defconfig
arm   viper_defconfig
ia64 alldefconfig
sh   se7721_defconfig
arm   corgi_defconfig
shedosk7760_defconfig
mipsomega2p_defconfig
powerpc  storcenter_defconfig
arm   tegra_defconfig
sparcallyesconfig
sparc   defconfig
ia64  tiger_defconfig
mipsjmr3927_defconfig
armxcep_defconfig
h8300allyesconfig
powerpc linkstation_defconfig
sparc   sparc32_defconfig
arm  badge4_defconfig
powerpc  pmac32_defconfig
riscv  rv32_defconfig
i386 allyesconfig
i386defconfig
i386  debian-10.3
i386  allnoconfig
ia64 allmodconfig
ia64defconfig
ia64  allnoconfig
ia64 allyesconfig
m68k allmodconfig
m68k  allnoconfig
m68k   sun3_defconfig
m68kdefconfig
m68k allyesconfig
nios2   defconfig
nios2allyesconfig
openriscdefconfig
c6x  allyesconfig
c6x   allnoconfig
openrisc allyesconfig
nds32   defconfig
csky allyesconfig
cskydefconfig
alpha   defconfig
alphaallyesconfig
xtensa   allyesconfig
h8300allmodconfig
xtensa  defconfig
arc defconfig
arc  allyesconfig
sh   allmodconfig
shallnoconfig
microblazeallnoconfig
mips allyesconfig
mips  allnoconfig
mips allmodconfig
pariscallnoconfig
parisc  defconfig
parisc   allyesconfig
parisc   allmodconfig
powerpc defconfig
powerpc  allyesconfig
powerpc  rhel-kconfig
powerpc  allmodconfig
powerpc   allnoconfig
i386 randconfig-a001-20200717
i386 randconfig-a005-20200717
i386 randconfig-a002-20200717
i386 randconfig-a006-20200717
i386 randconfig-a003-20200717
i386 randconfig-a004-20200717
x86_64   randconfig-a012-20200716
x86_64   randconfig-a011-20200716
x86_64   randconfig-a016-20200716
x86_64   randconfig-a014-20200716
x86_64   randconfig-a013-20200716
x86_64   randconfig-a015-20200716
x86_64   randconfig-a005-20200717
x86_64   randconfig-a006-20200717
x86_64   randconfig-a002-20200717
x86_64   randconfig-a001-20200717
x86_64   randconfig-a003-20200717
x86_64   randconfig-a004-20200717
i386 randconfig-a016-20200717
i386 randconfig-a011-20200717
i386 randconfig-a015-20200717
i386 randconfig-a012-20200717
i386 randconfig-a013-20200717
i386 randconfig-a014-20200717
riscvallyesconfig
riscv allnoconfig
riscv   defconfig
riscv

[PATCH] mISDN: switch from 'pci_' to 'dma_' API

2020-07-18 Thread Christophe JAILLET
The wrappers in include/linux/pci-dma-compat.h should go away.

The patch has been generated with the coccinelle script below and has been
hand modified to replace GFP_ with a correct flag.
It has been compile tested.

When memory is allocated in 'setup_hw()' (hfcpci.c) GFP_KERNEL can be used
because it is called from the probe function and no lock is taken.
The call chain is:
   hfc_probe()
   --> setup_card()
   --> setup_hw()

When memory is allocated in 'inittiger()' (netjet.c) GFP_ATOMIC must be
used because a spin_lock is taken by the caller (i.e. 'nj_init_card()')
This is also consistent with the other allocations done in the function.

@@
@@
-PCI_DMA_BIDIRECTIONAL
+DMA_BIDIRECTIONAL

@@
@@
-PCI_DMA_TODEVICE
+DMA_TO_DEVICE

@@
@@
-PCI_DMA_FROMDEVICE
+DMA_FROM_DEVICE

@@
@@
-PCI_DMA_NONE
+DMA_NONE

@@
expression e1, e2, e3;
@@
-pci_alloc_consistent(e1, e2, e3)
+dma_alloc_coherent(>dev, e2, e3, GFP_)

@@
expression e1, e2, e3;
@@
-pci_zalloc_consistent(e1, e2, e3)
+dma_alloc_coherent(>dev, e2, e3, GFP_)

@@
expression e1, e2, e3, e4;
@@
-pci_free_consistent(e1, e2, e3, e4)
+dma_free_coherent(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_map_single(e1, e2, e3, e4)
+dma_map_single(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_unmap_single(e1, e2, e3, e4)
+dma_unmap_single(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4, e5;
@@
-pci_map_page(e1, e2, e3, e4, e5)
+dma_map_page(>dev, e2, e3, e4, e5)

@@
expression e1, e2, e3, e4;
@@
-pci_unmap_page(e1, e2, e3, e4)
+dma_unmap_page(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_map_sg(e1, e2, e3, e4)
+dma_map_sg(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_unmap_sg(e1, e2, e3, e4)
+dma_unmap_sg(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_dma_sync_single_for_cpu(e1, e2, e3, e4)
+dma_sync_single_for_cpu(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_dma_sync_single_for_device(e1, e2, e3, e4)
+dma_sync_single_for_device(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_dma_sync_sg_for_cpu(e1, e2, e3, e4)
+dma_sync_sg_for_cpu(>dev, e2, e3, e4)

@@
expression e1, e2, e3, e4;
@@
-pci_dma_sync_sg_for_device(e1, e2, e3, e4)
+dma_sync_sg_for_device(>dev, e2, e3, e4)

@@
expression e1, e2;
@@
-pci_dma_mapping_error(e1, e2)
+dma_mapping_error(>dev, e2)

@@
expression e1, e2;
@@
-pci_set_dma_mask(e1, e2)
+dma_set_mask(>dev, e2)

@@
expression e1, e2;
@@
-pci_set_consistent_dma_mask(e1, e2)
+dma_set_coherent_mask(>dev, e2)

Signed-off-by: Christophe JAILLET 
---
If needed, see post from Christoph Hellwig on the kernel-janitors ML:
   https://marc.info/?l=kernel-janitors=158745678307186=4
---
 drivers/isdn/hardware/mISDN/hfcpci.c | 12 +++-
 drivers/isdn/hardware/mISDN/netjet.c |  8 
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c 
b/drivers/isdn/hardware/mISDN/hfcpci.c
index abdf787c1a71..904a4f4c5ff9 100644
--- a/drivers/isdn/hardware/mISDN/hfcpci.c
+++ b/drivers/isdn/hardware/mISDN/hfcpci.c
@@ -158,7 +158,8 @@ release_io_hfcpci(struct hfc_pci *hc)
/* disable memory mapped ports + busmaster */
pci_write_config_word(hc->pdev, PCI_COMMAND, 0);
del_timer(>hw.timer);
-   pci_free_consistent(hc->pdev, 0x8000, hc->hw.fifos, hc->hw.dmahandle);
+   dma_free_coherent(>pdev->dev, 0x8000, hc->hw.fifos,
+ hc->hw.dmahandle);
iounmap(hc->hw.pci_io);
 }
 
@@ -2004,8 +2005,9 @@ setup_hw(struct hfc_pci *hc)
}
/* Allocate memory for FIFOS */
/* the memory needs to be on a 32k boundary within the first 4G */
-   pci_set_dma_mask(hc->pdev, 0x8000);
-   buffer = pci_alloc_consistent(hc->pdev, 0x8000, >hw.dmahandle);
+   dma_set_mask(>pdev->dev, 0x8000);
+   buffer = dma_alloc_coherent(>pdev->dev, 0x8000, >hw.dmahandle,
+   GFP_KERNEL);
/* We silently assume the address is okay if nonzero */
if (!buffer) {
printk(KERN_WARNING
@@ -2018,8 +2020,8 @@ setup_hw(struct hfc_pci *hc)
if (unlikely(!hc->hw.pci_io)) {
printk(KERN_WARNING
   "HFC-PCI: Error in ioremap for PCI!\n");
-   pci_free_consistent(hc->pdev, 0x8000, hc->hw.fifos,
-   hc->hw.dmahandle);
+   dma_free_coherent(>pdev->dev, 0x8000, hc->hw.fifos,
+ hc->hw.dmahandle);
return 1;
}
 
diff --git a/drivers/isdn/hardware/mISDN/netjet.c 
b/drivers/isdn/hardware/mISDN/netjet.c
index 6aae97e827b7..ee925b58bbce 100644
--- a/drivers/isdn/hardware/mISDN/netjet.c
+++ b/drivers/isdn/hardware/mISDN/netjet.c
@@ -297,8 +297,8 @@ inittiger(struct tiger_hw *card)
 {
int i;
 
-   card->dma_p = 

[tip:timers/core] BUILD SUCCESS 36cd28a4cdd05d47ccb62a2d86e8f37839cc879a

2020-07-18 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git  
timers/core
branch HEAD: 36cd28a4cdd05d47ccb62a2d86e8f37839cc879a  timers: Lower base clock 
forwarding threshold

i386-tinyconfig vmlinux size:

=
 TOTAL  TEXT  run_timer_softirq()  calc_wheel_index()   
 
=
 0 00   0  30c66fc30ee7 timer: 
Prevent base->clk from moving backward
+7+50  +5  e2a71bdea816 timer: Fix 
wheel index calculation on last level 
  +414  +412 +186+108  
dcb7fd82c75e..36cd28a4cdd0 (ALL COMMITS)  
=

elapsed time: 726m

configs tested: 112
configs skipped: 1

The following configs have been built successfully.
More configs may be tested in the coming days.

arm defconfig
arm  allyesconfig
arm  allmodconfig
arm   allnoconfig
arm64allyesconfig
arm64   defconfig
arm64allmodconfig
arm64 allnoconfig
nds32 allnoconfig
powerpc  ppc64e_defconfig
arm   viper_defconfig
ia64 alldefconfig
sh   se7721_defconfig
arm   corgi_defconfig
shedosk7760_defconfig
mipsomega2p_defconfig
powerpc  storcenter_defconfig
arm   tegra_defconfig
h8300allyesconfig
powerpc linkstation_defconfig
sparc   sparc32_defconfig
arm  badge4_defconfig
powerpc  pmac32_defconfig
riscv  rv32_defconfig
i386  allnoconfig
i386 allyesconfig
i386defconfig
i386  debian-10.3
ia64 allmodconfig
ia64defconfig
ia64  allnoconfig
ia64 allyesconfig
m68k allmodconfig
m68k  allnoconfig
m68k   sun3_defconfig
m68kdefconfig
m68k allyesconfig
nios2   defconfig
nios2allyesconfig
openriscdefconfig
c6x  allyesconfig
c6x   allnoconfig
openrisc allyesconfig
nds32   defconfig
csky allyesconfig
cskydefconfig
alpha   defconfig
alphaallyesconfig
xtensa   allyesconfig
h8300allmodconfig
xtensa  defconfig
arc defconfig
arc  allyesconfig
sh   allmodconfig
shallnoconfig
microblazeallnoconfig
mips allyesconfig
mips  allnoconfig
mips allmodconfig
pariscallnoconfig
parisc  defconfig
parisc   allyesconfig
parisc   allmodconfig
powerpc  allyesconfig
powerpc  rhel-kconfig
powerpc  allmodconfig
powerpc   allnoconfig
powerpc defconfig
i386 randconfig-a001-20200717
i386 randconfig-a005-20200717
i386 randconfig-a002-20200717
i386 randconfig-a006-20200717
i386 randconfig-a003-20200717
i386 randconfig-a004-20200717
x86_64   randconfig-a005-20200717
x86_64   randconfig-a006-20200717
x86_64   randconfig-a002-20200717
x86_64   randconfig-a001-20200717
x86_64   randconfig-a003-20200717
x86_64   randconfig-a004-20200717
x86_64   randconfig-a012-20200716
x86_64   randconfig-a011-20200716
x86_64 

[tip:timers/urgent] BUILD SUCCESS e2a71bdea81690b6ef11f4368261ec6f5b6891aa

2020-07-18 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git  
timers/urgent
branch HEAD: e2a71bdea81690b6ef11f4368261ec6f5b6891aa  timer: Fix wheel index 
calculation on last level

elapsed time: 726m

configs tested: 84
configs skipped: 1

The following configs have been built successfully.
More configs may be tested in the coming days.

arm defconfig
arm  allyesconfig
arm  allmodconfig
arm   allnoconfig
arm64allyesconfig
arm64   defconfig
arm64allmodconfig
arm64 allnoconfig
arm   corgi_defconfig
shedosk7760_defconfig
mipsomega2p_defconfig
powerpc  storcenter_defconfig
arm   tegra_defconfig
h8300allyesconfig
powerpc linkstation_defconfig
sparc   sparc32_defconfig
arm  badge4_defconfig
powerpc  pmac32_defconfig
riscv  rv32_defconfig
i386 allyesconfig
i386defconfig
i386  debian-10.3
i386  allnoconfig
ia64 allmodconfig
ia64defconfig
ia64  allnoconfig
ia64 allyesconfig
m68k allmodconfig
m68k  allnoconfig
m68k   sun3_defconfig
m68kdefconfig
m68k allyesconfig
nds32   defconfig
nds32 allnoconfig
csky allyesconfig
cskydefconfig
alpha   defconfig
alphaallyesconfig
xtensa   allyesconfig
h8300allmodconfig
xtensa  defconfig
arc defconfig
arc  allyesconfig
sh   allmodconfig
shallnoconfig
microblazeallnoconfig
nios2   defconfig
nios2allyesconfig
openriscdefconfig
c6x  allyesconfig
c6x   allnoconfig
openrisc allyesconfig
mips allyesconfig
mips  allnoconfig
mips allmodconfig
pariscallnoconfig
parisc  defconfig
parisc   allyesconfig
parisc   allmodconfig
powerpc defconfig
powerpc  allyesconfig
powerpc  rhel-kconfig
powerpc  allmodconfig
powerpc   allnoconfig
riscvallyesconfig
riscv allnoconfig
riscv   defconfig
riscvallmodconfig
s390 allyesconfig
s390  allnoconfig
s390 allmodconfig
s390defconfig
sparcallyesconfig
sparc   defconfig
sparc64 defconfig
sparc64   allnoconfig
sparc64  allyesconfig
sparc64  allmodconfig
x86_64rhel-7.6-kselftests
x86_64   rhel-8.3
x86_64  kexec
x86_64   rhel
x86_64lkp
x86_64  fedora-25

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org


[PATCH] serial: altera_jtaguart: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.


 drivers/tty/serial/altera_jtaguart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/altera_jtaguart.c 
b/drivers/tty/serial/altera_jtaguart.c
index c90e503d6b57..d0ca9cf29b62 100644
--- a/drivers/tty/serial/altera_jtaguart.c
+++ b/drivers/tty/serial/altera_jtaguart.c
@@ -27,7 +27,7 @@
 
 /*
  * Altera JTAG UART register definitions according to the Altera JTAG UART
- * datasheet: http://www.altera.com/literature/hb/nios2/n2cpu_nii51009.pdf
+ * datasheet: https://www.altera.com/literature/hb/nios2/n2cpu_nii51009.pdf
  */
 
 #define ALTERA_JTAGUART_SIZE   8
-- 
2.27.0



Re: [PATCH v7 3/5] MIPS: Ingenic: Let the Kconfig of platform enable the clocksource driver.

2020-07-18 Thread Zhou Yanjie

Hi Sergei,

在 2020/7/18 下午4:39, Sergei Shtylyov 写道:

Hello!

On 17.07.2020 19:59, 周琰杰 (Zhou Yanjie) wrote:


The previous clocksource patch in this series ([2/3]) has remove


  Removed.


"default MACH_INGENIC" and make option silent, so we need to


  Made?


enable the corresponding driver in the platform's Kconfig.

Suggested-by: Daniel Lezcano 
Tested-by: 周正 (Zhou Zheng) 
Signed-off-by: 周琰杰 (Zhou Yanjie) 
---

Notes:
 v7:
 New patch.

  arch/mips/jz4740/Kconfig | 7 +++
  1 file changed, 7 insertions(+)

diff --git a/arch/mips/jz4740/Kconfig b/arch/mips/jz4740/Kconfig
index 6c065dcaeff8..5ad60998702e 100644
--- a/arch/mips/jz4740/Kconfig
+++ b/arch/mips/jz4740/Kconfig
@@ -36,27 +36,34 @@ endchoice
  config MACH_JZ4740
  bool
  select SYS_HAS_CPU_MIPS32_R1
+    select INGENIC_TIMER


   Please use tab instead of spaces here an below.



Sure, I will do it in the next version.

Thanks and best regards!



[...]

MBR, Sergei


[PATCH] tty: serial: uartlite: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.


 drivers/tty/serial/uartlite.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c
index 7dbd0c471d92..09379db613d8 100644
--- a/drivers/tty/serial/uartlite.c
+++ b/drivers/tty/serial/uartlite.c
@@ -32,7 +32,7 @@
  * Register definitions
  *
  * For register details see datasheet:
- * 
http://www.xilinx.com/support/documentation/ip_documentation/opb_uartlite.pdf
+ * 
https://www.xilinx.com/support/documentation/ip_documentation/opb_uartlite.pdf
  */
 
 #define ULITE_RX   0x00
-- 
2.27.0



[PATCH] net: dsa: felix: Make some symbols static

2020-07-18 Thread Wang Hai
Fix sparse build warning:

drivers/net/dsa/ocelot/felix_vsc9959.c:560:19: warning:
 symbol 'vsc9959_vcap_is2_keys' was not declared. Should it be static?
drivers/net/dsa/ocelot/felix_vsc9959.c:640:19: warning:
 symbol 'vsc9959_vcap_is2_actions' was not declared. Should it be static?

Reported-by: Hulk Robot 
Signed-off-by: Wang Hai 
---
 drivers/net/dsa/ocelot/felix_vsc9959.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c 
b/drivers/net/dsa/ocelot/felix_vsc9959.c
index 1dd9e348152d..2067776773f7 100644
--- a/drivers/net/dsa/ocelot/felix_vsc9959.c
+++ b/drivers/net/dsa/ocelot/felix_vsc9959.c
@@ -557,7 +557,7 @@ static const struct ocelot_stat_layout 
vsc9959_stats_layout[] = {
{ .offset = 0x111,  .name = "drop_green_prio_7", },
 };
 
-struct vcap_field vsc9959_vcap_is2_keys[] = {
+static struct vcap_field vsc9959_vcap_is2_keys[] = {
/* Common: 41 bits */
[VCAP_IS2_TYPE] = {  0,   4},
[VCAP_IS2_HK_FIRST] = {  4,   1},
@@ -637,7 +637,7 @@ struct vcap_field vsc9959_vcap_is2_keys[] = {
[VCAP_IS2_HK_OAM_IS_Y1731]  = {182,   1},
 };
 
-struct vcap_field vsc9959_vcap_is2_actions[] = {
+static struct vcap_field vsc9959_vcap_is2_actions[] = {
[VCAP_IS2_ACT_HIT_ME_ONCE]  = {  0,  1},
[VCAP_IS2_ACT_CPU_COPY_ENA] = {  1,  1},
[VCAP_IS2_ACT_CPU_QU_NUM]   = {  2,  3},
-- 
2.17.1



[PATCH] ipw2x00: Replace HTTP links with HTTPS ones

2020-07-18 Thread Alexander A. Klimov
Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
  If not .svg:
For each line:
  If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
  If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
  Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov 
---
 Continuing my work started at 93431e0607e5.
 See also: git log --oneline '--author=Alexander A. Klimov 
' v5.7..master

 If there are any URLs to be removed completely
 or at least not (just) HTTPSified:
 Just clearly say so and I'll *undo my change*.
 See also: https://lkml.org/lkml/2020/6/27/64

 If there are any valid, but yet not changed URLs:
 See: https://lkml.org/lkml/2020/6/26/837

 If you apply the patch, please let me know.


 Documentation/networking/device_drivers/intel/ipw2100.rst | 2 +-
 drivers/net/wireless/intel/ipw2x00/Kconfig| 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/networking/device_drivers/intel/ipw2100.rst 
b/Documentation/networking/device_drivers/intel/ipw2100.rst
index d54ad522f937..883e96355799 100644
--- a/Documentation/networking/device_drivers/intel/ipw2100.rst
+++ b/Documentation/networking/device_drivers/intel/ipw2100.rst
@@ -78,7 +78,7 @@ such, if you are interested in deploying or shipping a driver 
as part of
 solution intended to be used for purposes other than development, please
 obtain a tested driver from Intel Customer Support at:
 
-http://www.intel.com/support/wireless/sb/CS-006408.htm
+https://www.intel.com/support/wireless/sb/CS-006408.htm
 
 1. Introduction
 ===
diff --git a/drivers/net/wireless/intel/ipw2x00/Kconfig 
b/drivers/net/wireless/intel/ipw2x00/Kconfig
index d00386915a9d..f3e09b630d8b 100644
--- a/drivers/net/wireless/intel/ipw2x00/Kconfig
+++ b/drivers/net/wireless/intel/ipw2x00/Kconfig
@@ -28,7 +28,7 @@ config IPW2100
  You will also very likely need the Wireless Tools in order to
  configure your card:
 
- .
+ .
 
  It is recommended that you compile this driver as a module (M)
  rather than built-in (Y). This driver requires firmware at device
@@ -90,7 +90,7 @@ config IPW2200
  You will also very likely need the Wireless Tools in order to
  configure your card:
 
- .
+ .
 
  It is recommended that you compile this driver as a module (M)
  rather than built-in (Y). This driver requires firmware at device
-- 
2.27.0



<    1   2   3   4   5   6   >