Re: [RFC 2/6] ipv4: add lockdep condition to fix for_each_entry

2019-06-02 Thread Pavel Machek
On Sat 2019-06-01 18:27:34, Joel Fernandes (Google) wrote:
> Signed-off-by: Joel Fernandes (Google) 

This really needs to be merged to previous patch, you can't break
compilation in middle of series...

Or probably you need hlist_for_each_entry_rcu_lockdep() macro with
additional argument, and switch users to it.
Pavel

>  net/ipv4/fib_frontend.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
> index b298255f6fdb..ef7c9f8e8682 100644
> --- a/net/ipv4/fib_frontend.c
> +++ b/net/ipv4/fib_frontend.c
> @@ -127,7 +127,8 @@ struct fib_table *fib_get_table(struct net *net, u32 id)
>   h = id & (FIB_TABLE_HASHSZ - 1);
>  
>   head = &net->ipv4.fib_table_hash[h];
> - hlist_for_each_entry_rcu(tb, head, tb_hlist) {
> + hlist_for_each_entry_rcu(tb, head, tb_hlist,
> +  lockdep_rtnl_is_held()) {
>   if (tb->tb_id == id)
>   return tb;
>   }

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature


Re: [PATCHv3 00/12] perf tools: Display eBPF code in intel_pt trace

2019-06-02 Thread Leo Yan
On Fri, May 31, 2019 at 11:19:44AM +0200, Jiri Olsa wrote:
> On Thu, May 30, 2019 at 10:05:10PM +0800, Leo Yan wrote:
> > Hi Arnaldo,
> > 
> > On Thu, May 30, 2019 at 10:36:45AM -0300, Arnaldo Carvalho de Melo wrote:
> > 
> > [...]
> > 
> > > One other way of testing this:
> > > 
> > > I used perf trace's use of BPF, using:
> > > 
> > > [root@quaco ~]# cat ~/.perfconfig
> > > [llvm]
> > >   dump-obj = true
> > >   clang-opt = -g
> > > [trace]
> > >   add_events = 
> > > /home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.c
> > >   show_zeros = yes
> > >   show_duration = no
> > >   no_inherit = yes
> > >   show_timestamp = no
> > >   show_arg_names = no
> > >   args_alignment = 40
> > >   show_prefix = yes
> > > 
> > > For arm64 this needs fixing, 
> > > tools/perf/examples/bpf/augmented_raw_syscalls.c
> > > (its in the kernel sources) is still hard coded for x86_64 syscall 
> > > numbers :-\
> > 
> > Thanks a lot for sharing this, I will test with this method and let you
> > and Jiri know the result in tomorrow.
> 
> it's always battle of having too much data but caturing everything,
> versus having reasonable data size and being lucky to hit the trace ;-)
> 
> with sampling on high freq and 1 second trace in another terminal
> I got the trace below:

Thanks a lot for confirmation, Jiri.

I tries multiple times with different frequency for sampleip command,
but still no luck to capture eBPF object info in perf data.  Will dig
into it and will keep you posted for this.

Thanks,
Leo Yan

> ---
> terminal 1:
>   # sampleip -F 1000 20
> 
> terminal2:
>   # perf-with-kcore record pt -e intel_pt//k -m100M,100M -C 1 -- sleep 1
>   # perf-with-kcore script pt --call-trace
>   ...
>  swapper 0 [001] 85820.051207146: ([kernel.kallsyms]  
>)  
> __perf_event_overflow   
>  swapper 0 [001] 85820.051207146: ([kernel.kallsyms]  
>)  
> __perf_event_account_interrupt  
>  swapper 0 [001] 85820.051207146: ([kernel.kallsyms]  
>)  
> __x86_indirect_thunk_rax
>  swapper 0 [001] 85820.051207146: ([kernel.kallsyms]  
>)  
> __x86_indirect_thunk_rax
>  swapper 0 [001] 85820.051207146: ([kernel.kallsyms]  
>)  
> __x86_indirect_thunk_rax
>  swapper 0 [001] 85820.051207146: ([kernel.kallsyms]  
>)  
> __x86_indirect_thunk_rax
>  swapper 0 [001] 85820.051207467: (bpf_prog_19578a12836c4115  
>)  
> __htab_map_lookup_elem  
>  swapper 0 [001] 85820.051207788: ([kernel.kallsyms]  
>)  
> memcmp  
>   ...
>   # perf-with-kcore script pt --insn-trace --xed
>   ...
>  swapper 0 [001] 85820.051207467:  90c00c40 
> __x86_indirect_thunk_rax+0x10 ([kernel.kallsyms])   retq  
>  swapper 0 [001] 85820.051207467:  c0557710 
> bpf_prog_19578a12836c4115+0x0 (bpf_prog_19578a12836c4115)   pushq 
>  %rbp
>  swapper 0 [001] 85820.051207467:  c0557711 
> bpf_prog_19578a12836c4115+0x1 (bpf_prog_19578a12836c4115)   mov 
> %rsp, %rbp
>  swapper 0 [001] 85820.051207467:  c0557714 
> bpf_prog_19578a12836c4115+0x4 (bpf_prog_19578a12836c4115)   sub 
> $0x38, %rsp
>  swapper 0 [001] 85820.051207467:  c055771b 
> bpf_prog_19578a12836c4115+0xb (bpf_prog_19578a12836c4115)   sub 
> $0x28, %rbp
>  swapper 0 [001] 85820.051207467:  c055771f 
> bpf_prog_19578a12836c4115+0xf (bpf_prog_19578a12836c4115)   movq  
> %rbx, (%rbp)
>  swapper 0 [001] 85820.051207467:  c0557723 
> bpf_prog_19578a12836c4115+0x13 (bpf_prog_19578a12836c4115)  movq  
> %r13, 0x8(%rbp)
>  swapper 0 [001] 85820.051207467:  c0557727 
> bpf_prog_19578a12836c4115+0x17 (bpf_prog_19578a12836c4115)  movq  
> %r14, 0x10(%rbp)
>  swapper 0 [001] 85820.051207467:  c055772b 
> bpf_prog_19578a12836c4115+0x1b (bpf_prog_19578a12836c4115)  movq  
> %r15, 0x18(%rbp)
>  swapper 0 [001] 85820.051207467:  c055772f 
> bpf_prog_19578a12836c4115+0x1f (bpf_

[GIT PULL] SPDX update for 5.2-rc3 - round 2

2019-06-02 Thread Greg KH
The following changes since commit 2f4c53349961c8ca480193e47da4d44fdb8335a8:

  Merge tag 'spdx-5.2-rc3-1' of 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core (2019-05-31 
08:34:32 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 
tags/spdx-5.2-rc3-2

for you to fetch changes up to 8e82fe2ab65a80b1526b285c661ab88cc5891e3a:

  treewide: fix typos of SPDX-License-Identifier (2019-06-01 18:29:58 +0200)


SPDX fixes for 5.2-rc3, round 2

Here are just two small patches, that fix up some found SPDX identifier
issues.

The first patch fixes an error in a previous SPDX fixup patch, that
causes build errors when doing 'make clean' on the tree (the fact that
almost no one noticed it reflects the fact that kernel developers don't
like doing that option very often...)

The second patch fixes up a number of places in the tree where people
mistyped the string "SPDX-License-Identifier".  Given that people can
not even type their own name all the time without mistakes, this was
bound to happen, and odds are, we will have to add some type of check
for this to checkpatch.pl to catch this happening in the future.

Both of these have passed testing by 0-day.

Signed-off-by: Greg Kroah-Hartman 


Alex Xu (Hello71) (1):
  crypto: ux500 - fix license comment syntax error

Masahiro Yamada (1):
  treewide: fix typos of SPDX-License-Identifier

 arch/arm/kernel/bugs.c| 2 +-
 drivers/crypto/ux500/cryp/Makefile| 2 +-
 drivers/phy/st/phy-stm32-usbphyc.c| 2 +-
 drivers/pinctrl/sh-pfc/pfc-r8a77980.c | 2 +-
 lib/test_stackinit.c  | 2 +-
 sound/soc/codecs/max9759.c| 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)


RE: [RFC PATCH 0/9] security: x86/sgx: SGX vs. LSM

2019-06-02 Thread Xing, Cedric
Hi Sean,

> From: Christopherson, Sean J
> Sent: Friday, May 31, 2019 4:32 PM
> 
> This series is the result of a rather absurd amount of discussion over how to 
> get SGX to play
> nice with LSM policies, without having to resort to evil shenanigans or put 
> undue burden on
> userspace.  The discussion definitely wandered into completely insane 
> territory at times, but
> I think/hope we ended up with something reasonable.
> 
> The basic gist of the approach is to require userspace to declare what 
> protections are
> maximally allowed for any given page, e.g. add a flags field for loading 
> enclave pages that
> takes ALLOW_{READ,WRITE,EXEC}.  LSMs can then adjust the allowed protections, 
> e.g. clear
> ALLOW_EXEC to prevent ever mapping the page with PROT_EXEC.  SGX enforces the 
> allowed perms
> via a new mprotect() vm_ops hook, e.g. like regular mprotect() uses 
> MAY_{READ,WRITE,EXEC}.
> 
> ALLOW_EXEC is used to deny hings like loading an enclave from a noexec file 
> system or from a
> file without EXECUTE permissions, e.g. without the ALLOW_EXEC concept, on 
> SGX2 hardware
> (regardless of kernel support) userspace could EADD from a noexec file using 
> read-only
> permissions, and later use mprotect() and ENCLU[EMODPE] to gain execute 
> permissions.
> 
> ALLOW_WRITE is used in conjuction with ALLOW_EXEC to enforce SELinux's 
> EXECMOD (or EXECMEM).
> 
> This is very much an RFC series.  It's only compile tested, likely has 
> obvious bugs, the
> SELinux patch could be completely harebrained, etc...
> My goal at this point is to get feedback at a macro level, e.g. is the core 
> concept
> viable/acceptable, are there objection to hooking mprotect(), etc...
> 
> Andy and Cedric, hopefully this aligns with your general expectations based 
> on our last
> discussion.

I couldn't understand the real intentions of ALLOW_* flags until I saw them in 
code. I have to say C is more expressive than English in that regard :)

Generally I agree with your direction but think ALLOW_* flags are completely 
internal to LSM because they can be both produced and consumed inside an LSM 
module. So spilling them into SGX driver and also user mode code makes the 
solution ugly and in some cases impractical because not every enclave host 
process has a priori knowledge on whether or not an enclave page would be 
EMODPE'd at runtime.

Theoretically speaking, what you really need is a per page flag (let's name it 
WRITTEN?) indicating whether a page has ever been written to (or more 
precisely, granted PROT_WRITE), which will be used to decide whether to grant 
PROT_EXEC when requested in future. Given the fact that all mprotect() goes 
through LSM and mmap() is limited to PROT_NONE, it's easy for LSM to capture 
that flag by itself instead of asking user mode code to provide it.

That said, here is the summary of what I think is a better approach.
* In hook security_file_alloc(), if @file is an enclave, allocate some data 
structure to store for every page, the WRITTEN flag as described above. WRITTEN 
is cleared initially for all pages.
  Open: Given a file of type struct file *, how to tell if it is an enclave 
(i.e. /dev/sgx/enclave)?
* In hook security_mmap_file(), if @file is an enclave, make sure @prot can 
only be PROT_NONE. This is to force all protection changes to go through 
security_file_mprotect().
* In the newly introduced hook security_enclave_load(), set WRITTEN for pages 
that are requested PROT_WRITE.
* In hook security_file_mprotect(), if @vma->vm_file is an enclave, look up and 
use WRITTEN flags for all pages within @vma, along with other global flags 
(e.g. PROCESS__EXECMEM/FILE__EXECMOD in the case of SELinux) to decide on 
allowing/rejecting @prot.
* In hook security_file_free(), if @file is an enclave, free storage allocated 
for WRITTEN flags. 

I'll try to make more detailed comments in my replies to individual patches 
sometime tomorrow.

> 
> Lastly, I added a patch to allow userspace to add multiple pages in a single 
> ioctl().  It's
> obviously not directly related to the security stuff, but the idea 
> tangentially came up during
> earlier discussions and it's something I think the UAPI should provide (it's 
> a tiny change).
> Since I was modifying the UAPI anyways, I threw it in.
> 
> Sean Christopherson (9):
>   x86/sgx: Remove unused local variable in sgx_encl_release()
>   x86/sgx: Do not naturally align MAP_FIXED address
>   x86/sgx: Allow userspace to add multiple pages in single ioctl()
>   mm: Introduce vm_ops->mprotect()
>   x86/sgx: Restrict mapping without an enclave page to PROT_NONE
>   x86/sgx: Require userspace to provide allowed prots to ADD_PAGES
>   x86/sgx: Enforce noexec filesystem restriction for enclaves
>   LSM: x86/sgx: Introduce ->enclave_load() hook for Intel SGX
>   security/selinux: Add enclave_load() implementation
> 
>  arch/x86/include/uapi/asm/sgx.h|  30 --
>  arch/x86/kernel/cpu/sgx/driver/ioctl.c | 143 +
> arch/x

RE: [PATCH net-next] qed: Fix build error without CONFIG_DEVLINK

2019-06-02 Thread Michal Kalderon
> From: netdev-ow...@vger.kernel.org 
> On Behalf Of YueHaibing
> 
> Fix gcc build error while CONFIG_DEVLINK is not set
> 
> drivers/net/ethernet/qlogic/qed/qed_main.o: In function `qed_remove':
> qed_main.c:(.text+0x1eb4): undefined reference to `devlink_unregister'
> 
> Select DEVLINK to fix this.
> 
> Reported-by: Hulk Robot 
> Fixes: 24e04879abdd ("qed: Add qed devlink parameters table")
> Signed-off-by: YueHaibing 
> ---
>  drivers/net/ethernet/qlogic/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/qlogic/Kconfig
> b/drivers/net/ethernet/qlogic/Kconfig
> index fdbb3ce..a391cf6 100644
> --- a/drivers/net/ethernet/qlogic/Kconfig
> +++ b/drivers/net/ethernet/qlogic/Kconfig
> @@ -87,6 +87,7 @@ config QED
>   depends on PCI
>   select ZLIB_INFLATE
>   select CRC8
> + select NET_DEVLINK
>   ---help---
> This enables the support for ...
> 
> --
> 2.7.4
> 

Thanks, 

Acked-by: Michal Kalderon 




[PATCH 1/5] arch: riscv: add support for building DTB files from DT source data

2019-06-02 Thread Paul Walmsley
Similar to ARM64, add support for building DTB files from DT source
data for RISC-V boards.

This patch starts with the infrastructure needed for SiFive boards.
Boards from other vendors would add support here in a similar form.

Signed-off-by: Paul Walmsley 
Signed-off-by: Paul Walmsley 
Cc: Palmer Dabbelt 
Cc: Albert Ou 
---
 arch/riscv/boot/dts/Makefile | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 arch/riscv/boot/dts/Makefile

diff --git a/arch/riscv/boot/dts/Makefile b/arch/riscv/boot/dts/Makefile
new file mode 100644
index ..dcc3ada78455
--- /dev/null
+++ b/arch/riscv/boot/dts/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0
+subdir-y += sifive
-- 
2.20.1



[PATCH 5/5] riscv: dts: add initial board data for the SiFive HiFive Unleashed

2019-06-02 Thread Paul Walmsley
Add initial board data for the SiFive HiFive Unleashed A00.

Currently the data populated in this DT file describes the board
DRAM configuration and the external clock sources that supply the
PRCI.

This third version incorporates changes based on more comments from
Rob Herring .

Signed-off-by: Paul Walmsley 
Signed-off-by: Paul Walmsley 
Cc: Rob Herring 
Cc: Mark Rutland 
Cc: Palmer Dabbelt 
Cc: Albert Ou 
Cc: devicet...@vger.kernel.org
Cc: linux-ri...@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/riscv/boot/dts/sifive/Makefile   |  2 +
 .../boot/dts/sifive/hifive-unleashed-a00.dts  | 67 +++
 2 files changed, 69 insertions(+)
 create mode 100644 arch/riscv/boot/dts/sifive/Makefile
 create mode 100644 arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts

diff --git a/arch/riscv/boot/dts/sifive/Makefile 
b/arch/riscv/boot/dts/sifive/Makefile
new file mode 100644
index ..baaeef9efdcb
--- /dev/null
+++ b/arch/riscv/boot/dts/sifive/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0
+dtb-y += hifive-unleashed-a00.dtb
diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts 
b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
new file mode 100644
index ..1de4ea1577d5
--- /dev/null
+++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
@@ -0,0 +1,67 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/* Copyright (c) 2018-2019 SiFive, Inc */
+
+/dts-v1/;
+
+#include "fu540-c000.dtsi"
+
+/* Clock frequency (in Hz) of the PCB crystal for rtcclk */
+#define RTCCLK_FREQ100
+
+/ {
+   #address-cells = <2>;
+   #size-cells = <2>;
+   model = "SiFive HiFive Unleashed A00";
+   compatible = "sifive,hifive-unleashed-a00", "sifive,fu540-c000";
+
+   chosen {
+   };
+
+   cpus {
+   timebase-frequency = ;
+   };
+
+   memory@8000 {
+   device_type = "memory";
+   reg = <0x0 0x8000 0x2 0x>;
+   };
+
+   soc {
+   };
+
+   hfclk: hfclk {
+   #clock-cells = <0>;
+   compatible = "fixed-clock";
+   clock-frequency = <>;
+   clock-output-names = "hfclk";
+   };
+
+   rtcclk: rtcclk {
+   #clock-cells = <0>;
+   compatible = "fixed-clock";
+   clock-frequency = ;
+   clock-output-names = "rtcclk";
+   };
+};
+
+&qspi0 {
+   flash@0 {
+   compatible = "issi,is25wp256", "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <5000>;
+   m25p,fast-read;
+   spi-tx-bus-width = <4>;
+   spi-rx-bus-width = <4>;
+   };
+};
+
+&qspi2 {
+   status = "okay";
+   mmc@0 {
+   compatible = "mmc-spi-slot";
+   reg = <0>;
+   spi-max-frequency = <2000>;
+   voltage-ranges = <3300 3300>;
+   disable-wp;
+   };
+};
-- 
2.20.1



[PATCH 3/5] dt-bindings: riscv: convert cpu binding to json-schema

2019-06-02 Thread Paul Walmsley
At Rob's request, we're starting to migrate our DT binding
documentation to json-schema YAML format.  Start by converting our cpu
binding documentation.  While doing so, document more properties and
nodes.  This includes adding binding documentation support for the E51
and U54 CPU cores ("harts") that are present on this SoC.  These cores
are described in:

https://static.dev.sifive.com/FU540-C000-v1.0.pdf

This cpus.yaml file is intended to be a starting point and to
evolve over time.  It passes dt-doc-validate as of the yaml-bindings
commit 4c79d42e9216.

This patch was originally based on the ARM json-schema binding
documentation as added by commit 672951cbd1b7 ("dt-bindings: arm: Convert
cpu binding to json-schema").

Signed-off-by: Paul Walmsley 
Signed-off-by: Paul Walmsley 
Cc: Rob Herring 
Cc: Mark Rutland 
Cc: Lorenzo Pieralisi 
Cc: devicet...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-ri...@lists.infradead.org
---
 .../devicetree/bindings/riscv/cpus.yaml   | 168 ++
 1 file changed, 168 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/riscv/cpus.yaml

diff --git a/Documentation/devicetree/bindings/riscv/cpus.yaml 
b/Documentation/devicetree/bindings/riscv/cpus.yaml
new file mode 100644
index ..6e8d55d9d4e1
--- /dev/null
+++ b/Documentation/devicetree/bindings/riscv/cpus.yaml
@@ -0,0 +1,168 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/riscv/cpus.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: RISC-V bindings for 'cpus' DT nodes
+
+maintainers:
+  - Paul Walmsley 
+  - Palmer Dabbelt 
+
+allOf:
+  - $ref: /schemas/cpus.yaml#
+
+properties:
+  $nodename:
+const: cpus
+description: Container of cpu nodes
+
+  '#address-cells':
+const: 1
+description: |
+  A single unsigned 32-bit integer uniquely identifies each RISC-V
+  hart in a system.  (See the "reg" node under the "cpu" node,
+  below).
+
+  '#size-cells':
+const: 0
+
+patternProperties:
+  '^cpu@[0-9a-f]+$':
+properties:
+  compatible:
+type: array
+items:
+  - enum:
+  - sifive,rocket0
+  - sifive,e5
+  - sifive,e51
+  - sifive,u54-mc
+  - sifive,u54
+  - sifive,u5
+  - const: riscv
+description:
+  Identifies that the hart uses the RISC-V instruction set
+  and identifies the type of the hart.
+
+  mmu-type:
+allOf:
+  - $ref: "/schemas/types.yaml#/definitions/string"
+  - enum:
+  - riscv,sv32
+  - riscv,sv39
+  - riscv,sv48
+description:
+  Identifies the MMU address translation mode used on this
+  hart.  These values originate from the RISC-V Privileged
+  Specification document, available from
+  https://riscv.org/specifications/
+
+  riscv,isa:
+allOf:
+  - $ref: "/schemas/types.yaml#/definitions/string"
+  - enum:
+  - rv64imac
+  - rv64imafdc
+description:
+  Identifies the specific RISC-V instruction set architecture
+  supported by the hart.  These are documented in the RISC-V
+  User-Level ISA document, available from
+  https://riscv.org/specifications/
+
+  timebase-frequency:
+type: integer
+minimum: 1
+description:
+  Specifies the clock frequency of the system timer in Hz.
+  This value is common to all harts on a single system image.
+
+  interrupt-controller:
+type: object
+description: Describes the CPU's local interrupt controller
+
+properties:
+  '#interrupt-cells':
+const: 1
+
+  compatible:
+const: riscv,cpu-intc
+
+  interrupt-controller: true
+
+required:
+  - '#interrupt-cells'
+  - compatible
+  - interrupt-controller
+
+required:
+  - riscv,isa
+  - timebase-frequency
+  - interrupt-controller
+
+examples:
+  - |
+// Example 1: SiFive Freedom U540G Development Kit
+cpus {
+#address-cells = <1>;
+#size-cells = <0>;
+timebase-frequency = <100>;
+cpu@0 {
+clock-frequency = <0>;
+compatible = "sifive,rocket0", "riscv";
+device_type = "cpu";
+i-cache-block-size = <64>;
+i-cache-sets = <128>;
+i-cache-size = <16384>;
+reg = <0>;
+riscv,isa = "rv64imac";
+cpu_intc0: interrupt-controller {
+#interrupt-cells = <1>;
+compatible = "riscv,cpu-intc";
+interrupt-controller;
+};
+};
+cpu@1 {
+clock-frequency = <0>;
+compatible = "sifive,rocket0", "ris

[PATCH 4/5] riscv: dts: add initial support for the SiFive FU540-C000 SoC

2019-06-02 Thread Paul Walmsley
Add initial support for the SiFive FU540-C000 SoC.  This is a 28nm SoC
based around the SiFive U54-MC core complex and a TileLink
interconnect.

This file is expected to grow as more device drivers are added to the
kernel.

This patch includes a fix to the QSPI memory map due to a
documentation bug, found by ShihPo Hung , adds
entries for the I2C controller, and merges all DT changes that
formerly were made dynamically by the riscv-pk BBL proxy kernel.

Signed-off-by: Paul Walmsley 
Signed-off-by: Paul Walmsley 
Cc: Rob Herring 
Cc: Mark Rutland 
Cc: Palmer Dabbelt 
Cc: Albert Ou 
Cc: ShihPo Hung 
Cc: devicet...@vger.kernel.org
Cc: linux-ri...@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/riscv/boot/dts/sifive/fu540-c000.dtsi | 215 +
 1 file changed, 215 insertions(+)
 create mode 100644 arch/riscv/boot/dts/sifive/fu540-c000.dtsi

diff --git a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi 
b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
new file mode 100644
index ..3c06ee4b2b29
--- /dev/null
+++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
@@ -0,0 +1,215 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/* Copyright (c) 2018-2019 SiFive, Inc */
+
+/dts-v1/;
+
+#include 
+
+/ {
+   #address-cells = <2>;
+   #size-cells = <2>;
+   compatible = "sifive,fu540-c000", "sifive,fu540";
+
+   aliases {
+   serial0 = &uart0;
+   serial1 = &uart1;
+   };
+
+   chosen {
+   };
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   timebase-frequency = <100>;
+   cpu0: cpu@0 {
+   compatible = "sifive,e51", "sifive,rocket0", "riscv";
+   device_type = "cpu";
+   i-cache-block-size = <64>;
+   i-cache-sets = <128>;
+   i-cache-size = <16384>;
+   reg = <0>;
+   riscv,isa = "rv64imac";
+   status = "disabled";
+   cpu0_intc: interrupt-controller {
+   #interrupt-cells = <1>;
+   compatible = "riscv,cpu-intc";
+   interrupt-controller;
+   };
+   };
+   cpu1: cpu@1 {
+   compatible = "sifive,u54-mc", "sifive,rocket0", "riscv";
+   d-cache-block-size = <64>;
+   d-cache-sets = <64>;
+   d-cache-size = <32768>;
+   d-tlb-sets = <1>;
+   d-tlb-size = <32>;
+   device_type = "cpu";
+   i-cache-block-size = <64>;
+   i-cache-sets = <64>;
+   i-cache-size = <32768>;
+   i-tlb-sets = <1>;
+   i-tlb-size = <32>;
+   mmu-type = "riscv,sv39";
+   reg = <1>;
+   riscv,isa = "rv64imafdc";
+   tlb-split;
+   cpu1_intc: interrupt-controller {
+   #interrupt-cells = <1>;
+   compatible = "riscv,cpu-intc";
+   interrupt-controller;
+   };
+   };
+   cpu2: cpu@2 {
+   clock-frequency = <0>;
+   compatible = "sifive,u54-mc", "sifive,rocket0", "riscv";
+   d-cache-block-size = <64>;
+   d-cache-sets = <64>;
+   d-cache-size = <32768>;
+   d-tlb-sets = <1>;
+   d-tlb-size = <32>;
+   device_type = "cpu";
+   i-cache-block-size = <64>;
+   i-cache-sets = <64>;
+   i-cache-size = <32768>;
+   i-tlb-sets = <1>;
+   i-tlb-size = <32>;
+   mmu-type = "riscv,sv39";
+   reg = <2>;
+   riscv,isa = "rv64imafdc";
+   tlb-split;
+   cpu2_intc: interrupt-controller {
+   #interrupt-cells = <1>;
+   compatible = "riscv,cpu-intc";
+   interrupt-controller;
+   };
+   };
+   cpu3: cpu@3 {
+   clock-frequency = <0>;
+   compatible = "sifive,u54-mc", "sifive,rocket0", "riscv";
+   d-cache-block-size = <64>;
+   d-cache-sets = <64>;
+   d-cache-size = <32768>;
+   d-tlb-sets = <1>;
+   d-tlb-size = <32>;
+   device_type = "cpu";
+   i-cache-block-size = <64>;
+   i

[PATCH 2/5] dt-bindings: riscv: sifive: add YAML documentation for the SiFive FU540

2019-06-02 Thread Paul Walmsley
Add YAML DT binding documentation for the SiFive FU540 SoC.  This
SoC is documented at:

https://static.dev.sifive.com/FU540-C000-v1.0.pdf

Passes dt-doc-validate, as of yaml-bindings commit 4c79d42e9216.

This second version incorporates review feedback from Rob Herring
.

Signed-off-by: Paul Walmsley 
Signed-off-by: Paul Walmsley 
Cc: Rob Herring 
Cc: Mark Rutland 
Cc: Palmer Dabbelt 
Cc: Albert Ou 
Cc: devicet...@vger.kernel.org
Cc: linux-ri...@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 .../devicetree/bindings/riscv/sifive.yaml | 25 +++
 MAINTAINERS   |  9 +++
 2 files changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/riscv/sifive.yaml

diff --git a/Documentation/devicetree/bindings/riscv/sifive.yaml 
b/Documentation/devicetree/bindings/riscv/sifive.yaml
new file mode 100644
index ..ce7ca191789e
--- /dev/null
+++ b/Documentation/devicetree/bindings/riscv/sifive.yaml
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/riscv/sifive.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SiFive SoC-based boards
+
+maintainers:
+  - Paul Walmsley 
+  - Palmer Dabbelt 
+
+description:
+  SiFive SoC-based boards
+
+properties:
+  $nodename:
+const: '/'
+  compatible:
+items:
+  - enum:
+  - sifive,freedom-unleashed-a00
+  - const: sifive,fu540-c000
+  - const: sifive,fu540
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 5cfbea4ce575..8a64051cf5fc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14322,6 +14322,15 @@ S: Supported
 K: sifive
 N: sifive
 
+SIFIVE FU540 SYSTEM-ON-CHIP
+M: Paul Walmsley 
+M: Palmer Dabbelt 
+L: linux-ri...@lists.infradead.org
+T: git git://git.kernel.org/pub/scm/linux/kernel/git/pjw/sifive.git
+S: Supported
+K: fu540
+N: fu540
+
 SILEAD TOUCHSCREEN DRIVER
 M: Hans de Goede 
 L: linux-in...@vger.kernel.org
-- 
2.20.1



[PATCH 0/5] arch: riscv: add board and SoC DT file support

2019-06-02 Thread Paul Walmsley
Add support for building flattened DT files from DT source files under
arch/riscv/boot/dts.  Follow existing kernel precedent from other SoC
architectures.  Start our board support by adding initial support for
the SiFive FU540 SoC and the first development board that uses it, the
SiFive HiFive Unleashed A00.

This third version of the patch set adds I2C data for the chip,
incorporates all remaining changes that riscv-pk was making
automatically, and addresses a comment from Rob Herring
.

Boot-tested on v5.2-rc1 on a HiFive Unleashed A00 board, using the
BBL and open-source FSBL, with modifications to pass in the DTB
file generated by these patches.

This patch series can be found, along with the PRCI patch set
and the DT macro prerequisite patch, at:

https://github.com/sifive/riscv-linux/tree/dev/paulw/dts-v5.2-rc1


- Paul


Paul Walmsley (5):
  arch: riscv: add support for building DTB files from DT source data
  dt-bindings: riscv: sifive: add YAML documentation for the SiFive
FU540
  dt-bindings: riscv: convert cpu binding to json-schema
  riscv: dts: add initial support for the SiFive FU540-C000 SoC
  riscv: dts: add initial board data for the SiFive HiFive Unleashed

 .../devicetree/bindings/riscv/cpus.yaml   | 168 ++
 .../devicetree/bindings/riscv/sifive.yaml |  25 ++
 MAINTAINERS   |   9 +
 arch/riscv/boot/dts/Makefile  |   2 +
 arch/riscv/boot/dts/sifive/Makefile   |   2 +
 arch/riscv/boot/dts/sifive/fu540-c000.dtsi| 215 ++
 .../boot/dts/sifive/hifive-unleashed-a00.dts  |  67 ++
 7 files changed, 488 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/riscv/cpus.yaml
 create mode 100644 Documentation/devicetree/bindings/riscv/sifive.yaml
 create mode 100644 arch/riscv/boot/dts/Makefile
 create mode 100644 arch/riscv/boot/dts/sifive/Makefile
 create mode 100644 arch/riscv/boot/dts/sifive/fu540-c000.dtsi
 create mode 100644 arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts

-- 
2.20.1



[PATCH 1/5] arch: riscv: add support for building DTB files from DT source data

2019-06-02 Thread Paul Walmsley
Similar to ARM64, add support for building DTB files from DT source
data for RISC-V boards.

This patch starts with the infrastructure needed for SiFive boards.
Boards from other vendors would add support here in a similar form.

Signed-off-by: Paul Walmsley 
Signed-off-by: Paul Walmsley 
Cc: Palmer Dabbelt 
Cc: Albert Ou 
---
 arch/riscv/boot/dts/Makefile | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 arch/riscv/boot/dts/Makefile

diff --git a/arch/riscv/boot/dts/Makefile b/arch/riscv/boot/dts/Makefile
new file mode 100644
index ..dcc3ada78455
--- /dev/null
+++ b/arch/riscv/boot/dts/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0
+subdir-y += sifive
-- 
2.20.1



[PATCH 0/5] arch: riscv: add board and SoC DT file support

2019-06-02 Thread Paul Walmsley
Add support for building flattened DT files from DT source files under
arch/riscv/boot/dts.  Follow existing kernel precedent from other SoC
architectures.  Start our board support by adding initial support for
the SiFive FU540 SoC and the first development board that uses it, the
SiFive HiFive Unleashed A00.

This third version of the patch set adds I2C data for the chip,
incorporates all remaining changes that riscv-pk was making
automatically, and addresses a comment from Rob Herring
.

Boot-tested on v5.2-rc1 on a HiFive Unleashed A00 board, using the
BBL and open-source FSBL, with modifications to pass in the DTB
file generated by these patches.

This patch series can be found, along with the PRCI patch set
and the DT macro prerequisite patch, at:

https://github.com/sifive/riscv-linux/tree/dev/paulw/dts-v5.2-rc1


- Paul


Paul Walmsley (5):
  arch: riscv: add support for building DTB files from DT source data
  dt-bindings: riscv: sifive: add YAML documentation for the SiFive
FU540
  dt-bindings: riscv: convert cpu binding to json-schema
  riscv: dts: add initial support for the SiFive FU540-C000 SoC
  riscv: dts: add initial board data for the SiFive HiFive Unleashed

 .../devicetree/bindings/riscv/cpus.yaml   | 168 ++
 .../devicetree/bindings/riscv/sifive.yaml |  25 ++
 MAINTAINERS   |   9 +
 arch/riscv/boot/dts/Makefile  |   2 +
 arch/riscv/boot/dts/sifive/Makefile   |   2 +
 arch/riscv/boot/dts/sifive/fu540-c000.dtsi| 215 ++
 .../boot/dts/sifive/hifive-unleashed-a00.dts  |  67 ++
 7 files changed, 488 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/riscv/cpus.yaml
 create mode 100644 Documentation/devicetree/bindings/riscv/sifive.yaml
 create mode 100644 arch/riscv/boot/dts/Makefile
 create mode 100644 arch/riscv/boot/dts/sifive/Makefile
 create mode 100644 arch/riscv/boot/dts/sifive/fu540-c000.dtsi
 create mode 100644 arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts

-- 
2.20.1



[PATCH v3 1/5] arch: riscv: add support for building DTB files from DT source data

2019-06-02 Thread Paul Walmsley
Similar to ARM64, add support for building DTB files from DT source
data for RISC-V boards.

This patch starts with the infrastructure needed for SiFive boards.
Boards from other vendors would add support here in a similar form.

Signed-off-by: Paul Walmsley 
Signed-off-by: Paul Walmsley 
Cc: Palmer Dabbelt 
Cc: Albert Ou 
---
 arch/riscv/boot/dts/Makefile | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 arch/riscv/boot/dts/Makefile

diff --git a/arch/riscv/boot/dts/Makefile b/arch/riscv/boot/dts/Makefile
new file mode 100644
index ..dcc3ada78455
--- /dev/null
+++ b/arch/riscv/boot/dts/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0
+subdir-y += sifive
-- 
2.20.1



[PATCH v3 4/5] riscv: dts: add initial support for the SiFive FU540-C000 SoC

2019-06-02 Thread Paul Walmsley
Add initial support for the SiFive FU540-C000 SoC.  This is a 28nm SoC
based around the SiFive U54-MC core complex and a TileLink
interconnect.

This file is expected to grow as more device drivers are added to the
kernel.

This patch includes a fix to the QSPI memory map due to a
documentation bug, found by ShihPo Hung , adds
entries for the I2C controller, and merges all DT changes that
formerly were made dynamically by the riscv-pk BBL proxy kernel.

Signed-off-by: Paul Walmsley 
Signed-off-by: Paul Walmsley 
Cc: Rob Herring 
Cc: Mark Rutland 
Cc: Palmer Dabbelt 
Cc: Albert Ou 
Cc: ShihPo Hung 
Cc: devicet...@vger.kernel.org
Cc: linux-ri...@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/riscv/boot/dts/sifive/fu540-c000.dtsi | 215 +
 1 file changed, 215 insertions(+)
 create mode 100644 arch/riscv/boot/dts/sifive/fu540-c000.dtsi

diff --git a/arch/riscv/boot/dts/sifive/fu540-c000.dtsi 
b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
new file mode 100644
index ..3c06ee4b2b29
--- /dev/null
+++ b/arch/riscv/boot/dts/sifive/fu540-c000.dtsi
@@ -0,0 +1,215 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/* Copyright (c) 2018-2019 SiFive, Inc */
+
+/dts-v1/;
+
+#include 
+
+/ {
+   #address-cells = <2>;
+   #size-cells = <2>;
+   compatible = "sifive,fu540-c000", "sifive,fu540";
+
+   aliases {
+   serial0 = &uart0;
+   serial1 = &uart1;
+   };
+
+   chosen {
+   };
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   timebase-frequency = <100>;
+   cpu0: cpu@0 {
+   compatible = "sifive,e51", "sifive,rocket0", "riscv";
+   device_type = "cpu";
+   i-cache-block-size = <64>;
+   i-cache-sets = <128>;
+   i-cache-size = <16384>;
+   reg = <0>;
+   riscv,isa = "rv64imac";
+   status = "disabled";
+   cpu0_intc: interrupt-controller {
+   #interrupt-cells = <1>;
+   compatible = "riscv,cpu-intc";
+   interrupt-controller;
+   };
+   };
+   cpu1: cpu@1 {
+   compatible = "sifive,u54-mc", "sifive,rocket0", "riscv";
+   d-cache-block-size = <64>;
+   d-cache-sets = <64>;
+   d-cache-size = <32768>;
+   d-tlb-sets = <1>;
+   d-tlb-size = <32>;
+   device_type = "cpu";
+   i-cache-block-size = <64>;
+   i-cache-sets = <64>;
+   i-cache-size = <32768>;
+   i-tlb-sets = <1>;
+   i-tlb-size = <32>;
+   mmu-type = "riscv,sv39";
+   reg = <1>;
+   riscv,isa = "rv64imafdc";
+   tlb-split;
+   cpu1_intc: interrupt-controller {
+   #interrupt-cells = <1>;
+   compatible = "riscv,cpu-intc";
+   interrupt-controller;
+   };
+   };
+   cpu2: cpu@2 {
+   clock-frequency = <0>;
+   compatible = "sifive,u54-mc", "sifive,rocket0", "riscv";
+   d-cache-block-size = <64>;
+   d-cache-sets = <64>;
+   d-cache-size = <32768>;
+   d-tlb-sets = <1>;
+   d-tlb-size = <32>;
+   device_type = "cpu";
+   i-cache-block-size = <64>;
+   i-cache-sets = <64>;
+   i-cache-size = <32768>;
+   i-tlb-sets = <1>;
+   i-tlb-size = <32>;
+   mmu-type = "riscv,sv39";
+   reg = <2>;
+   riscv,isa = "rv64imafdc";
+   tlb-split;
+   cpu2_intc: interrupt-controller {
+   #interrupt-cells = <1>;
+   compatible = "riscv,cpu-intc";
+   interrupt-controller;
+   };
+   };
+   cpu3: cpu@3 {
+   clock-frequency = <0>;
+   compatible = "sifive,u54-mc", "sifive,rocket0", "riscv";
+   d-cache-block-size = <64>;
+   d-cache-sets = <64>;
+   d-cache-size = <32768>;
+   d-tlb-sets = <1>;
+   d-tlb-size = <32>;
+   device_type = "cpu";
+   i-cache-block-size = <64>;
+   i

[PATCH v3 3/5] dt-bindings: riscv: convert cpu binding to json-schema

2019-06-02 Thread Paul Walmsley
At Rob's request, we're starting to migrate our DT binding
documentation to json-schema YAML format.  Start by converting our cpu
binding documentation.  While doing so, document more properties and
nodes.  This includes adding binding documentation support for the E51
and U54 CPU cores ("harts") that are present on this SoC.  These cores
are described in:

https://static.dev.sifive.com/FU540-C000-v1.0.pdf

This cpus.yaml file is intended to be a starting point and to
evolve over time.  It passes dt-doc-validate as of the yaml-bindings
commit 4c79d42e9216.

This patch was originally based on the ARM json-schema binding
documentation as added by commit 672951cbd1b7 ("dt-bindings: arm: Convert
cpu binding to json-schema").

Signed-off-by: Paul Walmsley 
Signed-off-by: Paul Walmsley 
Cc: Rob Herring 
Cc: Mark Rutland 
Cc: Lorenzo Pieralisi 
Cc: devicet...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-ri...@lists.infradead.org
---
 .../devicetree/bindings/riscv/cpus.yaml   | 168 ++
 1 file changed, 168 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/riscv/cpus.yaml

diff --git a/Documentation/devicetree/bindings/riscv/cpus.yaml 
b/Documentation/devicetree/bindings/riscv/cpus.yaml
new file mode 100644
index ..6e8d55d9d4e1
--- /dev/null
+++ b/Documentation/devicetree/bindings/riscv/cpus.yaml
@@ -0,0 +1,168 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/riscv/cpus.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: RISC-V bindings for 'cpus' DT nodes
+
+maintainers:
+  - Paul Walmsley 
+  - Palmer Dabbelt 
+
+allOf:
+  - $ref: /schemas/cpus.yaml#
+
+properties:
+  $nodename:
+const: cpus
+description: Container of cpu nodes
+
+  '#address-cells':
+const: 1
+description: |
+  A single unsigned 32-bit integer uniquely identifies each RISC-V
+  hart in a system.  (See the "reg" node under the "cpu" node,
+  below).
+
+  '#size-cells':
+const: 0
+
+patternProperties:
+  '^cpu@[0-9a-f]+$':
+properties:
+  compatible:
+type: array
+items:
+  - enum:
+  - sifive,rocket0
+  - sifive,e5
+  - sifive,e51
+  - sifive,u54-mc
+  - sifive,u54
+  - sifive,u5
+  - const: riscv
+description:
+  Identifies that the hart uses the RISC-V instruction set
+  and identifies the type of the hart.
+
+  mmu-type:
+allOf:
+  - $ref: "/schemas/types.yaml#/definitions/string"
+  - enum:
+  - riscv,sv32
+  - riscv,sv39
+  - riscv,sv48
+description:
+  Identifies the MMU address translation mode used on this
+  hart.  These values originate from the RISC-V Privileged
+  Specification document, available from
+  https://riscv.org/specifications/
+
+  riscv,isa:
+allOf:
+  - $ref: "/schemas/types.yaml#/definitions/string"
+  - enum:
+  - rv64imac
+  - rv64imafdc
+description:
+  Identifies the specific RISC-V instruction set architecture
+  supported by the hart.  These are documented in the RISC-V
+  User-Level ISA document, available from
+  https://riscv.org/specifications/
+
+  timebase-frequency:
+type: integer
+minimum: 1
+description:
+  Specifies the clock frequency of the system timer in Hz.
+  This value is common to all harts on a single system image.
+
+  interrupt-controller:
+type: object
+description: Describes the CPU's local interrupt controller
+
+properties:
+  '#interrupt-cells':
+const: 1
+
+  compatible:
+const: riscv,cpu-intc
+
+  interrupt-controller: true
+
+required:
+  - '#interrupt-cells'
+  - compatible
+  - interrupt-controller
+
+required:
+  - riscv,isa
+  - timebase-frequency
+  - interrupt-controller
+
+examples:
+  - |
+// Example 1: SiFive Freedom U540G Development Kit
+cpus {
+#address-cells = <1>;
+#size-cells = <0>;
+timebase-frequency = <100>;
+cpu@0 {
+clock-frequency = <0>;
+compatible = "sifive,rocket0", "riscv";
+device_type = "cpu";
+i-cache-block-size = <64>;
+i-cache-sets = <128>;
+i-cache-size = <16384>;
+reg = <0>;
+riscv,isa = "rv64imac";
+cpu_intc0: interrupt-controller {
+#interrupt-cells = <1>;
+compatible = "riscv,cpu-intc";
+interrupt-controller;
+};
+};
+cpu@1 {
+clock-frequency = <0>;
+compatible = "sifive,rocket0", "ris

[PATCH v3 2/5] dt-bindings: riscv: sifive: add YAML documentation for the SiFive FU540

2019-06-02 Thread Paul Walmsley
Add YAML DT binding documentation for the SiFive FU540 SoC.  This
SoC is documented at:

https://static.dev.sifive.com/FU540-C000-v1.0.pdf

Passes dt-doc-validate, as of yaml-bindings commit 4c79d42e9216.

This second version incorporates review feedback from Rob Herring
.

Signed-off-by: Paul Walmsley 
Signed-off-by: Paul Walmsley 
Cc: Rob Herring 
Cc: Mark Rutland 
Cc: Palmer Dabbelt 
Cc: Albert Ou 
Cc: devicet...@vger.kernel.org
Cc: linux-ri...@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 .../devicetree/bindings/riscv/sifive.yaml | 25 +++
 MAINTAINERS   |  9 +++
 2 files changed, 34 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/riscv/sifive.yaml

diff --git a/Documentation/devicetree/bindings/riscv/sifive.yaml 
b/Documentation/devicetree/bindings/riscv/sifive.yaml
new file mode 100644
index ..ce7ca191789e
--- /dev/null
+++ b/Documentation/devicetree/bindings/riscv/sifive.yaml
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/riscv/sifive.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SiFive SoC-based boards
+
+maintainers:
+  - Paul Walmsley 
+  - Palmer Dabbelt 
+
+description:
+  SiFive SoC-based boards
+
+properties:
+  $nodename:
+const: '/'
+  compatible:
+items:
+  - enum:
+  - sifive,freedom-unleashed-a00
+  - const: sifive,fu540-c000
+  - const: sifive,fu540
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 5cfbea4ce575..8a64051cf5fc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14322,6 +14322,15 @@ S: Supported
 K: sifive
 N: sifive
 
+SIFIVE FU540 SYSTEM-ON-CHIP
+M: Paul Walmsley 
+M: Palmer Dabbelt 
+L: linux-ri...@lists.infradead.org
+T: git git://git.kernel.org/pub/scm/linux/kernel/git/pjw/sifive.git
+S: Supported
+K: fu540
+N: fu540
+
 SILEAD TOUCHSCREEN DRIVER
 M: Hans de Goede 
 L: linux-in...@vger.kernel.org
-- 
2.20.1



[PATCH v3 0/5] arch: riscv: add board and SoC DT file support

2019-06-02 Thread Paul Walmsley
Add support for building flattened DT files from DT source files under
arch/riscv/boot/dts.  Follow existing kernel precedent from other SoC
architectures.  Start our board support by adding initial support for
the SiFive FU540 SoC and the first development board that uses it, the
SiFive HiFive Unleashed A00.

This third version of the patch set adds I2C data for the chip,
incorporates all remaining changes that riscv-pk was making
automatically, and addresses a comment from Rob Herring
.

Boot-tested on v5.2-rc1 on a HiFive Unleashed A00 board, using the
BBL and open-source FSBL, with modifications to pass in the DTB
file generated by these patches.

This patch series can be found, along with the PRCI patch set
and the DT macro prerequisite patch, at:

https://github.com/sifive/riscv-linux/tree/dev/paulw/dts-v5.2-rc1


- Paul


Paul Walmsley (5):
  arch: riscv: add support for building DTB files from DT source data
  dt-bindings: riscv: sifive: add YAML documentation for the SiFive
FU540
  dt-bindings: riscv: convert cpu binding to json-schema
  riscv: dts: add initial support for the SiFive FU540-C000 SoC
  riscv: dts: add initial board data for the SiFive HiFive Unleashed

 .../devicetree/bindings/riscv/cpus.yaml   | 168 ++
 .../devicetree/bindings/riscv/sifive.yaml |  25 ++
 MAINTAINERS   |   9 +
 arch/riscv/boot/dts/Makefile  |   2 +
 arch/riscv/boot/dts/sifive/Makefile   |   2 +
 arch/riscv/boot/dts/sifive/fu540-c000.dtsi| 215 ++
 .../boot/dts/sifive/hifive-unleashed-a00.dts  |  67 ++
 7 files changed, 488 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/riscv/cpus.yaml
 create mode 100644 Documentation/devicetree/bindings/riscv/sifive.yaml
 create mode 100644 arch/riscv/boot/dts/Makefile
 create mode 100644 arch/riscv/boot/dts/sifive/Makefile
 create mode 100644 arch/riscv/boot/dts/sifive/fu540-c000.dtsi
 create mode 100644 arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts

-- 
2.20.1



[PATCH v3 5/5] riscv: dts: add initial board data for the SiFive HiFive Unleashed

2019-06-02 Thread Paul Walmsley
Add initial board data for the SiFive HiFive Unleashed A00.

Currently the data populated in this DT file describes the board
DRAM configuration and the external clock sources that supply the
PRCI.

This third version incorporates changes based on more comments from
Rob Herring .

Signed-off-by: Paul Walmsley 
Signed-off-by: Paul Walmsley 
Cc: Rob Herring 
Cc: Mark Rutland 
Cc: Palmer Dabbelt 
Cc: Albert Ou 
Cc: devicet...@vger.kernel.org
Cc: linux-ri...@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
 arch/riscv/boot/dts/sifive/Makefile   |  2 +
 .../boot/dts/sifive/hifive-unleashed-a00.dts  | 67 +++
 2 files changed, 69 insertions(+)
 create mode 100644 arch/riscv/boot/dts/sifive/Makefile
 create mode 100644 arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts

diff --git a/arch/riscv/boot/dts/sifive/Makefile 
b/arch/riscv/boot/dts/sifive/Makefile
new file mode 100644
index ..baaeef9efdcb
--- /dev/null
+++ b/arch/riscv/boot/dts/sifive/Makefile
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0
+dtb-y += hifive-unleashed-a00.dtb
diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts 
b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
new file mode 100644
index ..1de4ea1577d5
--- /dev/null
+++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts
@@ -0,0 +1,67 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/* Copyright (c) 2018-2019 SiFive, Inc */
+
+/dts-v1/;
+
+#include "fu540-c000.dtsi"
+
+/* Clock frequency (in Hz) of the PCB crystal for rtcclk */
+#define RTCCLK_FREQ100
+
+/ {
+   #address-cells = <2>;
+   #size-cells = <2>;
+   model = "SiFive HiFive Unleashed A00";
+   compatible = "sifive,hifive-unleashed-a00", "sifive,fu540-c000";
+
+   chosen {
+   };
+
+   cpus {
+   timebase-frequency = ;
+   };
+
+   memory@8000 {
+   device_type = "memory";
+   reg = <0x0 0x8000 0x2 0x>;
+   };
+
+   soc {
+   };
+
+   hfclk: hfclk {
+   #clock-cells = <0>;
+   compatible = "fixed-clock";
+   clock-frequency = <>;
+   clock-output-names = "hfclk";
+   };
+
+   rtcclk: rtcclk {
+   #clock-cells = <0>;
+   compatible = "fixed-clock";
+   clock-frequency = ;
+   clock-output-names = "rtcclk";
+   };
+};
+
+&qspi0 {
+   flash@0 {
+   compatible = "issi,is25wp256", "jedec,spi-nor";
+   reg = <0>;
+   spi-max-frequency = <5000>;
+   m25p,fast-read;
+   spi-tx-bus-width = <4>;
+   spi-rx-bus-width = <4>;
+   };
+};
+
+&qspi2 {
+   status = "okay";
+   mmc@0 {
+   compatible = "mmc-spi-slot";
+   reg = <0>;
+   spi-max-frequency = <2000>;
+   voltage-ranges = <3300 3300>;
+   disable-wp;
+   };
+};
-- 
2.20.1



Sorry for the extra noise

2019-06-02 Thread Paul Walmsley


Sorry for the extra noise on the recent DT patch series posts.  It seems 
my patch posting scripts malfunctioned.


- Paul


[PATCH] staging: rtl8188eu: remove ODM_PhyStatusQuery() wrapper

2019-06-02 Thread Michael Straube
Function ODM_PhyStatusQuery() is just a wrapper around
ODM_PhyStatusQuery_92CSeries(). Rename ODM_PhyStatusQuery_92CSeries()
to ODM_PhyStatusQuery() and remove the wrapper.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/hal/odm_hwconfig.c | 15 +++
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c 
b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
index 149b0009ad66..d5a9ac51e907 100644
--- a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
+++ b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
@@ -387,10 +387,9 @@ static void odm_Process_RSSIForDM(struct odm_dm_struct 
*dm_odm,
 }
 
 /*  Endianness before calling this API */
-static void ODM_PhyStatusQuery_92CSeries(struct odm_dm_struct *dm_odm,
-struct odm_phy_status_info *pPhyInfo,
-u8 *pPhyStatus,
-struct odm_per_pkt_info *pPktinfo)
+void ODM_PhyStatusQuery(struct odm_dm_struct *dm_odm,
+   struct odm_phy_status_info *pPhyInfo,
+   u8 *pPhyStatus, struct odm_per_pkt_info *pPktinfo)
 {
odm_RxPhyStatus92CSeries_Parsing(dm_odm, pPhyInfo, pPhyStatus,
 pPktinfo);
@@ -398,12 +397,4 @@ static void ODM_PhyStatusQuery_92CSeries(struct 
odm_dm_struct *dm_odm,
;/*  Select the packets to do RSSI checking for antenna 
switching. */
else
odm_Process_RSSIForDM(dm_odm, pPhyInfo, pPktinfo);
-
-}
-
-void ODM_PhyStatusQuery(struct odm_dm_struct *dm_odm,
-   struct odm_phy_status_info *pPhyInfo,
-   u8 *pPhyStatus, struct odm_per_pkt_info *pPktinfo)
-{
-   ODM_PhyStatusQuery_92CSeries(dm_odm, pPhyInfo, pPhyStatus, pPktinfo);
 }
-- 
2.21.0



Re: [PATCH] binfmt_flat: make load_flat_shared_library() work

2019-06-02 Thread Sergei Poselenov
Hello Arnd, all,

On Wed, 2019-05-29 at 14:05 +0200, Arnd Bergmann wrote:
> On Tue, May 28, 2019 at 12:56 PM Greg Ungerer 
> wrote:
> > On 27/5/19 11:38 pm, Jann Horn wrote:
> > > On Sat, May 25, 2019 at 11:43 PM Andrew Morton
> > >  wrote:
> > > > On Fri, 24 May 2019 22:18:17 +0200 Jann Horn 
> > > > wrote:
> > > > > load_flat_shared_library() is broken: It only calls
> > > > > load_flat_file() if
> > > > > prepare_binprm() returns zero, but prepare_binprm() returns
> > > > > the number of
> > > > > bytes read - so this only happens if the file is empty.
> > > > 
> > > > ouch.
> > > > 
> > > > > Instead, call into load_flat_file() if the number of bytes
> > > > > read is
> > > > > non-negative. (Even if the number of bytes is zero - in that
> > > > > case,
> > > > > load_flat_file() will see nullbytes and return a nice
> > > > > -ENOEXEC.)
> > > > > 
> > > > > In addition, remove the code related to bprm creds and stop
> > > > > using
> > > > > prepare_binprm() - this code is loading a library, not a main
> > > > > executable,
> > > > > and it only actually uses the members "buf", "file" and
> > > > > "filename" of the
> > > > > linux_binprm struct. Instead, call kernel_read() directly.
> > > > > 
> > > > > Cc: sta...@vger.kernel.org
> > > > > Fixes: 287980e49ffc ("remove lots of IS_ERR_VALUE abuses")
> > > > > Signed-off-by: Jann Horn 
> > > > > ---
> > > > > I only found the bug by looking at the code, I have not
> > > > > verified its
> > > > > existence at runtime.
> > > > > Also, this patch is compile-tested only.
> > > > > It would be nice if someone who works with nommu Linux could
> > > > > have a
> > > > > look at this patch.
> > > > 
> > > > 287980e49ffc was three years ago!  Has it really been broken
> > > > for all
> > > > that time?  If so, it seems a good source of freed disk
> > > > space...
> > > 
> > > Maybe... but I didn't want to rip it out without having one of
> > > the
> > > maintainers confirm that this really isn't likely to be used
> > > anymore.
> > 
> > I have not used shared libraries on m68k non-mmu setups for
> > a very long time. At least 10 years I would think.
> 
> I think Emcraft have a significant customer base running ARM NOMMU
> Linux, I wonder whether they would have run into this (adding
> Sergei to Cc).
> My suspicion is that they use only binfmt-elf-fdpic, not binfmt-flat.
> 

We use both, acutally, but all-static. We don't support shared
libraries with bFLT or ELF FDPIC.

Kind regards,
Sergei
> The only architectures I see that enable binfmt-flat are sh, xtensa
> and h8300, but only arch/sh uses CONFIG_BINFMT_SHARED_FLAT
> for a few machine specific configurations, and I'm in turn fairly
> sure
> those machines have not run a recent kernel in many years.
> 
> The one SH nommu platform likely to have users is j2, and that is
> probably always used with musl-libc with elf-fdpic (given that
> Rich Felker maintains both the kernel port and the library).
> 
>   Arnd
> 



Re: [PATCH -next] pinctrl: bcm2835: Fix build error without CONFIG_OF

2019-06-02 Thread Linus Walleij
On Tue, May 28, 2019 at 11:18 AM YueHaibing  wrote:

> drivers/pinctrl/bcm/pinctrl-bcm2835.c: In function 
> bcm2835_pctl_dt_node_to_map:
> drivers/pinctrl/bcm/pinctrl-bcm2835.c:720:8: error: implicit declaration of 
> function pinconf_generic_dt_node_to_map_all;
> drivers/pinctrl/bcm/pinctrl-bcm2835.c: In function bcm2835_pinctrl_probe:
> drivers/pinctrl/bcm/pinctrl-bcm2835.c:1022:15: error: struct gpio_chip has no 
> member named of_node
>   pc->gpio_chip.of_node = np;
>
> Reported-by: Hulk Robot 
> Fixes: 0de704955ee4 ("pinctrl: bcm2835: Add support for generic pinctrl 
> binding")
> Signed-off-by: YueHaibing 

Patch applied.

Yours,
Linus Walleij


Re: [PATCH 6/7] scsi: mac_scsi: Enable PDMA on Mac IIfx

2019-06-02 Thread Geert Uytterhoeven
Hi Finn,

On Sun, Jun 2, 2019 at 3:29 AM Finn Thain  wrote:
> Add support for Apple's custom "SCSI DMA" chip. This patch doesn't make
> use of its DMA capability. Just the PDMA capability is sufficient to
> improve sequential read throughput by a factor of 5.
>
> Cc: Michael Schmitz 
> Cc: Joshua Thompson 
> Cc: Geert Uytterhoeven 
> Tested-by: Stan Johnson 
> Signed-off-by: Finn Thain 

Thanks for your patch!

> ---
>  arch/m68k/mac/config.c  | 10 +++--

For the  m68k change to go in through the SCSI tree:
Acked-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


Re: [PATCH 5/7] scsi: mac_scsi: Fix pseudo DMA implementation, take 2

2019-06-02 Thread Geert Uytterhoeven
Hi Finn,

On Sun, Jun 2, 2019 at 3:29 AM Finn Thain  wrote:
> A system bus error during a PDMA transfer can mess up the calculation of
> the transfer residual (the PDMA handshaking hardware lacks a byte
> counter). This results in data corruption.
>
> The algorithm in this patch anticipates a bus error by starting each
> transfer with a MOVE.B instruction. If a bus error is caught the transfer
> will be retried. If a bus error is caught later in the transfer (for a
> MOVE.W instruction) the transfer gets failed and subsequent requests for
> that target will use PIO instead of PDMA.
>
> This avoids the "!REQ and !ACK" error so the severity level of that
> message is reduced to KERN_DEBUG.
>
> Cc: Michael Schmitz 
> Cc: Geert Uytterhoeven 
> Cc: sta...@vger.kernel.org # v4.14+
> Fixes: 3a0f64bfa907 ("mac_scsi: Fix pseudo DMA implementation")
> Reported-by: Chris Jones 
> Tested-by: Stan Johnson 
> Signed-off-by: Finn Thain 

Thanks for your patch!

> ---
>  arch/m68k/include/asm/mac_pdma.h | 179 +++
>  drivers/scsi/mac_scsi.c  | 201 ---

Why have you moved the PDMA implementation to a header file under
arch/m68k/? Do you intend to reuse it by other drivers?

If not, please keep it in the driver, so (a) you don't need an ack from
me ;-), and (b) your change may be easier to review.

Thanks!

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


Dear Friend.

2019-06-02 Thread Mr. Hassan Alwan Ali
-- 
Dear Friend,

I know that this mail will come to you as a surprise since we have not
known or met before now, but please, I would like you to treat it like
blood brother affair and with the urgency and secrecy it requires. I
am Mr. Hassan Alwan Ali, an Audit staff of (C.B.N) Central Bank of
Nigeria.


An investor (name with-held) died without naming any next of kin to
his fund he deposited in my bank. The amount is $10.5M ( Ten million
five hundred united state dollars ) and banking regulation/legislation
in Nigeria demands that I should notify the fiscal authorities after
three years.

The above set of facts underscores my reason to seek your permission
to have you stand in as the next of kin to the deceased.

This fund will be approved and released in your favour as the next of
kin if only you will adhere to my instruction and cooperate with me in
one accord.

I have all the legal and banking details of the deceased client that
will facilitate our putting you forward as the claimant/beneficiary of
the funds and ultimately transfer of the $10.5M plus interest to any
bank account nominated by you.

I am prepared to compensate you with a 35% share of the total funds
for your efforts. The final details will be given upon receipt an
affirmation of your desire to participate.

Please contact me immediately on ( hassan_alwanal...@yahoo.com  ) if
you are interest in my proposal to enable me not to start scouting for
another foreign partner.

Thanks,
Mr. Hassan Alwan Ali.


[PATCH V2 1/2] zpool: Add malloc_support_movable to zpool_driver

2019-06-02 Thread Hui Zhu
As a zpool_driver, zsmalloc can allocate movable memory because it
support migate pages.
But zbud and z3fold cannot allocate movable memory.

This commit adds malloc_support_movable to zpool_driver.
If a zpool_driver support allocate movable memory, set it to true.
And add zpool_malloc_support_movable check malloc_support_movable
to make sure if a zpool support allocate movable memory.

Signed-off-by: Hui Zhu 
---
 include/linux/zpool.h |  3 +++
 mm/zpool.c| 16 
 mm/zsmalloc.c | 19 ++-
 3 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/include/linux/zpool.h b/include/linux/zpool.h
index 7238865e75b0..51bf43076165 100644
--- a/include/linux/zpool.h
+++ b/include/linux/zpool.h
@@ -46,6 +46,8 @@ const char *zpool_get_type(struct zpool *pool);
 
 void zpool_destroy_pool(struct zpool *pool);
 
+bool zpool_malloc_support_movable(struct zpool *pool);
+
 int zpool_malloc(struct zpool *pool, size_t size, gfp_t gfp,
unsigned long *handle);
 
@@ -90,6 +92,7 @@ struct zpool_driver {
struct zpool *zpool);
void (*destroy)(void *pool);
 
+   bool malloc_support_movable;
int (*malloc)(void *pool, size_t size, gfp_t gfp,
unsigned long *handle);
void (*free)(void *pool, unsigned long handle);
diff --git a/mm/zpool.c b/mm/zpool.c
index a2dd9107857d..863669212070 100644
--- a/mm/zpool.c
+++ b/mm/zpool.c
@@ -238,6 +238,22 @@ const char *zpool_get_type(struct zpool *zpool)
return zpool->driver->type;
 }
 
+/**
+ * zpool_malloc_support_movable() - Check if the zpool support
+ * allocate movable memory
+ * @zpool: The zpool to check
+ *
+ * This returns if the zpool support allocate movable memory.
+ *
+ * Implementations must guarantee this to be thread-safe.
+ *
+ * Returns: true if if the zpool support allocate movable memory, false if not
+ */
+bool zpool_malloc_support_movable(struct zpool *zpool)
+{
+   return zpool->driver->malloc_support_movable;
+}
+
 /**
  * zpool_malloc() - Allocate memory
  * @zpool: The zpool to allocate from.
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 0787d33b80d8..8f3d9a4d46f4 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -437,15 +437,16 @@ static u64 zs_zpool_total_size(void *pool)
 }
 
 static struct zpool_driver zs_zpool_driver = {
-   .type = "zsmalloc",
-   .owner =THIS_MODULE,
-   .create =   zs_zpool_create,
-   .destroy =  zs_zpool_destroy,
-   .malloc =   zs_zpool_malloc,
-   .free = zs_zpool_free,
-   .map =  zs_zpool_map,
-   .unmap =zs_zpool_unmap,
-   .total_size =   zs_zpool_total_size,
+   .type =   "zsmalloc",
+   .owner =  THIS_MODULE,
+   .create = zs_zpool_create,
+   .destroy =zs_zpool_destroy,
+   .malloc_support_movable = true,
+   .malloc = zs_zpool_malloc,
+   .free =   zs_zpool_free,
+   .map =zs_zpool_map,
+   .unmap =  zs_zpool_unmap,
+   .total_size = zs_zpool_total_size,
 };
 
 MODULE_ALIAS("zpool-zsmalloc");
-- 
2.20.1 (Apple Git-117)



[PATCH V2 2/2] zswap: Add module parameter malloc_movable_if_support

2019-06-02 Thread Hui Zhu
This is the second version that was updated according to the comments
from Sergey Senozhatsky in https://lkml.org/lkml/2019/5/29/73

zswap compresses swap pages into a dynamically allocated RAM-based
memory pool.  The memory pool should be zbud, z3fold or zsmalloc.
All of them will allocate unmovable pages.  It will increase the
number of unmovable page blocks that will bad for anti-fragment.

zsmalloc support page migration if request movable page:
handle = zs_malloc(zram->mem_pool, comp_len,
GFP_NOIO | __GFP_HIGHMEM |
__GFP_MOVABLE);

And commit "zpool: Add malloc_support_movable to zpool_driver" add
zpool_malloc_support_movable check malloc_support_movable to make
sure if a zpool support allocate movable memory.

This commit adds module parameter malloc_movable_if_support to enable
or disable zpool allocate block with gfp __GFP_HIGHMEM | __GFP_MOVABLE
if it support allocate movable memory (disabled by default).

Following part is test log in a pc that has 8G memory and 2G swap.

When it disabled:
 echo lz4 > /sys/module/zswap/parameters/compressor
 echo zsmalloc > /sys/module/zswap/parameters/zpool
 echo 1 > /sys/module/zswap/parameters/enabled
 swapon /swapfile
 cd /home/teawater/kernel/vm-scalability/
/home/teawater/kernel/vm-scalability# export unit_size=$((9 * 1024 * 1024 * 
1024))
/home/teawater/kernel/vm-scalability# ./case-anon-w-seq
2717908992 bytes / 3977932 usecs = 667233 KB/s
2717908992 bytes / 4160702 usecs = 637923 KB/s
2717908992 bytes / 4354611 usecs = 609516 KB/s
293359 usecs to free memory
340304 usecs to free memory
205781 usecs to free memory
2717908992 bytes / 5588016 usecs = 474982 KB/s
166124 usecs to free memory
/home/teawater/kernel/vm-scalability# cat /proc/pagetypeinfo
Page block order: 9
Pages per block:  512

Free pages count per migrate type at order   0  1  2  3  4  
5  6  7  8  9 10
Node0, zone  DMA, typeUnmovable  1  1  1  0  2  
1  1  0  1  0  0
Node0, zone  DMA, type  Movable  0  0  0  0  0  
0  0  0  0  1  3
Node0, zone  DMA, type  Reclaimable  0  0  0  0  0  
0  0  0  0  0  0
Node0, zone  DMA, type   HighAtomic  0  0  0  0  0  
0  0  0  0  0  0
Node0, zone  DMA, type  CMA  0  0  0  0  0  
0  0  0  0  0  0
Node0, zone  DMA, type  Isolate  0  0  0  0  0  
0  0  0  0  0  0
Node0, zoneDMA32, typeUnmovable  5 10  9  8  8  
5  1  2  3  0  0
Node0, zoneDMA32, type  Movable 15 16 14 12 14  
   10  9  6  6  5776
Node0, zoneDMA32, type  Reclaimable  0  0  0  0  0  
0  0  0  0  0  0
Node0, zoneDMA32, type   HighAtomic  0  0  0  0  0  
0  0  0  0  0  0
Node0, zoneDMA32, type  CMA  0  0  0  0  0  
0  0  0  0  0  0
Node0, zoneDMA32, type  Isolate  0  0  0  0  0  
0  0  0  0  0  0
Node0, zone   Normal, typeUnmovable   7097   6914   6473   5642   4373  
 2664   1220319 78  4  0
Node0, zone   Normal, type  Movable   2092   3216   2820   2266   1585  
  946559359237258378
Node0, zone   Normal, type  Reclaimable 47 88122 80 34  
9  5  4  2  1  2
Node0, zone   Normal, type   HighAtomic  0  0  0  0  0  
0  0  0  0  0  0
Node0, zone   Normal, type  CMA  0  0  0  0  0  
0  0  0  0  0  0
Node0, zone   Normal, type  Isolate  0  0  0  0  0  
0  0  0  0  0  0

Number of blocks type Unmovable  Movable  Reclaimable   HighAtomic  
CMA  Isolate
Node 0, zone  DMA1700   
 00
Node 0, zoneDMA324 165200   
 00
Node 0, zone   Normal  834 1572   250   
 00

When it enabled:
 echo lz4 > /sys/module/zswap/parameters/compressor
 echo zsmalloc > /sys/module/zswap/parameters/zpool
 echo 1 > /sys/module/zswap/parameters/enabled
 echo 1 > /sys/module/zswap/parameters/malloc_movable_if_support
 swapon /swapfile
 cd /home/teawater/kernel/vm-scalability/
/home/teawater/kernel/vm-scalability# export unit_size=$((9 * 1024 * 1024 * 
1024))
/home/teawater/kernel/vm-scalability# ./case-anon-w-seq
2717908992 bytes / 4721401 usec

[GIT PULL] KVM fixes for 5.2-rc3

2019-06-02 Thread Paolo Bonzini
Linus,

The following changes since commit cd6c84d8f0cdc911df435bb075ba22ce3c605b07:

  Linux 5.2-rc2 (2019-05-26 16:49:19 -0700)

are available in the git repository at:

  https://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus

for you to fetch changes up to f8d221d2e0e1572d0d60174c118e3554d1aa79fa:

  Merge tag 'kvm-s390-master-5.2-2' of 
git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into kvm-master 
(2019-06-01 00:49:02 +0200)



Fixes for PPC and s390.


Christian Borntraeger (1):
  kvm: fix compile on s390 part 2

Cédric Le Goater (7):
  KVM: PPC: Book3S HV: XIVE: Clear file mapping when device is released
  KVM: PPC: Book3S HV: XIVE: Do not test the EQ flag validity when resetting
  KVM: PPC: Book3S HV: XIVE: Fix the enforced limit on the vCPU identifier
  KVM: PPC: Book3S HV: XIVE: Introduce a new mutex for the XIVE device
  KVM: PPC: Book3S HV: XIVE: Do not clear IRQ data of passthrough interrupts
  KVM: PPC: Book3S HV: XIVE: Take the srcu read lock when accessing memslots
  KVM: PPC: Book3S HV: XIVE: Fix page offset when clearing ESB pages

Paolo Bonzini (2):
  Merge tag 'kvm-ppc-fixes-5.2-1' of 
git://git.kernel.org/.../paulus/powerpc into kvm-master
  Merge tag 'kvm-s390-master-5.2-2' of 
git://git.kernel.org/.../kvms390/linux into kvm-master

Paul Mackerras (5):
  KVM: PPC: Book3S HV: Avoid touching arch.mmu_ready in XIVE release 
functions
  KVM: PPC: Book3S HV: Use new mutex to synchronize MMU setup
  KVM: PPC: Book3S: Use new mutex to synchronize access to rtas token list
  KVM: PPC: Book3S HV: Don't take kvm->lock around kvm_for_each_vcpu
  KVM: PPC: Book3S HV: Fix lockdep warning when entering guest on POWER9

Suraj Jitindar Singh (1):
  KVM: PPC: Book3S HV: Restore SPRG3 in kvmhv_p9_guest_entry()

Thomas Huth (1):
  KVM: s390: Do not report unusabled IDs via KVM_CAP_MAX_VCPU_ID

 arch/mips/kvm/mips.c  |   3 +
 arch/powerpc/include/asm/kvm_host.h   |   2 +
 arch/powerpc/kvm/book3s.c |   1 +
 arch/powerpc/kvm/book3s_64_mmu_hv.c   |  36 ++--
 arch/powerpc/kvm/book3s_hv.c  |  48 ++--
 arch/powerpc/kvm/book3s_rtas.c|  14 ++---
 arch/powerpc/kvm/book3s_xive.c|  55 +--
 arch/powerpc/kvm/book3s_xive.h|   1 +
 arch/powerpc/kvm/book3s_xive_native.c | 100 +++---
 arch/powerpc/kvm/powerpc.c|   3 +
 arch/s390/kvm/kvm-s390.c  |   1 +
 arch/x86/kvm/x86.c|   3 +
 virt/kvm/arm/arm.c|   3 +
 virt/kvm/kvm_main.c   |   4 +-
 14 files changed, 157 insertions(+), 117 deletions(-)


Re: [RFC PATCH 4/5] media: ov6650: Fix frame scaling not reset on crop

2019-06-02 Thread Janusz Krzysztofik
Hi Sakari,

On Sunday, June 2, 2019 12:37:55 AM CEST Sakari Ailus wrote:
> 
> ... I realised that the subtle effect of "media:
> ov6650: Register with asynchronous subdevice framework" is that the driver
> is now responsible for serialising the access to its own data structures
> now. 

Indeed, I must have been not thinking much while preparing it, only following 
patterns from other implementations blindly, sorry.

> And it doesn't do that. Could you submit a fix, please? It'd be good to
> get that to 5.2 through the fixes branch.

How about dropping that V4L2_SUBDEV_FL_HAS_DEVNODE flag for now?  I think that 
will be the most safe approach for a quick fix.  I'd then re-add it together 
with proper locking in a separate patch later.  What do yo think?

Thanks,
Janusz




SEEKING FOR INVESTMENT PROJECT

2019-06-02 Thread Che Zakiah Binti Din
Dear Sir/ Madam,

Please forgive me if my request is not acceptable by your kind person,
I got your email contact through international business directory and
I decided to contact you.

I am Mrs. Che Zakiah Binti Din, Working at MAYBANK (Malaysia) as the
Non-Executive Director & Audit Department Manager.  During our last
banking Audits we discovered an abandoned account belongs to one of
our Foreign Deceased Customer, Late Mr. Wang Jian, The Co-founder and
Co-chairman of HNA Group, a Chinese conglomerate with significant real
estate ownerships across the U.S., died in an accident while on a
business trip in France on Tuesday.

Please go through this link:
https://observer.com/2018/07/wang-jian-hna-founder-dies-tragic-fall/

 I am writing to request your assistance in transferring the sum of
$15.000.000.00 (Fifteen Million United States Dollars) into your
account as the Late Mr. Wang Jian Foreign Business Partner. Meanwhile,
before I contacted you I have done personal investigation in locating
any of Late Mr. Wang Jian relatives who knows about the account, but I
came out unsuccessful.

I will like to bring to your notice that I have made all the necessary
arrangements with my colleagues to transfer the funds into your
nominated bank account without any problem.  Upon your consideration
and acceptance of this offer, I am willing to offer you 40% for your
assistant, while 60% for me which I am planning to invest into a
profitable business venture in your country.

 More details information will be forwarded to you to breakdown
explaining comprehensively what require of you.

Waiting for your urgent reply,
Best Regards
Mrs. Che Zakiah Binti Din.


Re: [PATCH 8/8] staging: rtl8712: Fixed CamelCase in struct _adapter from drv_types.h

2019-06-02 Thread Deepak Mishra
On Sat, Jun 01, 2019 at 12:26:02PM -0700, Joe Perches wrote:
> On Sun, 2019-06-02 at 00:13 +0530, Deepak Mishra wrote:
> > This patch fixes CamelCase blnEnableRxFF0Filter by renaming it
> > to bln_enable_rx_ff0_filter in drv_types.h and related files rtl871x_cmd.c
> > xmit_linux.c
>
> One could also improve this by removing the
> hungarian like bln_ prefix and simplify the
> name of the boolean variable.
>
 Thank you for your suggestion and I am modifying accordingly and
 sending a V2 patch.
> > diff --git a/drivers/staging/rtl8712/drv_types.h 
> > b/drivers/staging/rtl8712/drv_types.h
> []
> > @@ -164,7 +164,7 @@ struct _adapter {
> > struct iw_statistics iwstats;
> > int pid; /*process id from UI*/
> > struct work_struct wk_filter_rx_ff0;
> > -   u8 blnEnableRxFF0Filter;
> > +   u8 bln_enable_rx_ff0_filter;
>
> e.g.:
>
>   bool enable_rx_ff0_filter;
>
> > diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c 
> > b/drivers/staging/rtl8712/rtl871x_cmd.c
> []
> > @@ -238,7 +238,7 @@ u8 r8712_sitesurvey_cmd(struct _adapter *padapter,
> > mod_timer(&pmlmepriv->scan_to_timer,
> >   jiffies + msecs_to_jiffies(SCANNING_TIMEOUT));
> > padapter->ledpriv.LedControlHandler(padapter, LED_CTL_SITE_SURVEY);
> > -   padapter->blnEnableRxFF0Filter = 0;
> > +   padapter->bln_enable_rx_ff0_filter = 0;
>
>   padapter->enable_rx_ff0_filter = false;
>
> > diff --git a/drivers/staging/rtl8712/xmit_linux.c 
> > b/drivers/staging/rtl8712/xmit_linux.c
> []
> > @@ -103,11 +103,11 @@ void r8712_SetFilter(struct work_struct *work)
> > r8712_write8(padapter, 0x117, newvalue);
> >
> > spin_lock_irqsave(&padapter->lockRxFF0Filter, irqL);
> > -   padapter->blnEnableRxFF0Filter = 1;
> > +   padapter->bln_enable_rx_ff0_filter = 1;
>
>   padapter->enable_rx_ff0_filter = true;
>
> etc...
>
> Then you could rename padapter to adapter, and maybe
> "struct _adapter" to something more sensible like
> "struct rtl8712dev" etc...
>
  Thanks for suggestion again. I am going to take it in a diferent patchset
  and submit that.

> And one day, hopefully sooner than later, realtek will
> improve their driver software base and help eliminate
> all the duplicated non-style defects across the family
> of drivers for their hardware...
>

Best regards

Deepak Mishra


Re: [PATCH 1/2] phy: core: Add phy_pm_runtime_enabled

2019-06-02 Thread Pavel Machek
Hi!

> > > The phy driver may need to check phy_pm_runtime_enabled() in suspend as
> > > PM runtime for phy may be already disabled when phy power_off() is called.
> > > 
> > > Cc: Pavel Machek 
> > > Cc: Sebastian Reichel 
> > > Signed-off-by: Tony Lindgren 
> > > ---
> > >  drivers/phy/phy-core.c  | 9 +
> > >  include/linux/phy/phy.h | 6 ++
> > >  2 files changed, 15 insertions(+)
> > > 
> > > diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> > > --- a/drivers/phy/phy-core.c
> > > +++ b/drivers/phy/phy-core.c
> > 
> > > diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> > > --- a/include/linux/phy/phy.h
> > > +++ b/include/linux/phy/phy.h
> > > @@ -158,6 +158,7 @@ int phy_pm_runtime_get(struct phy *phy);
> > >  int phy_pm_runtime_get_sync(struct phy *phy);
> > >  int phy_pm_runtime_put(struct phy *phy);
> > >  int phy_pm_runtime_put_sync(struct phy *phy);
> > > +bool phy_pm_runtime_enabled(struct phy *phy);
> > >  void phy_pm_runtime_allow(struct phy *phy);
> > >  void phy_pm_runtime_forbid(struct phy *phy);
> > >  int phy_init(struct phy *phy);
> > > @@ -240,6 +241,11 @@ static inline int phy_pm_runtime_put_sync(struct phy 
> > > *phy)
> > >   return -ENOSYS;
> > >  }
> > >  
> > > +static inline bool phy_pm_runtime_enabled(struct phy *phy)
> > > +{
> > > + return false
> > 
> > Missing semicolon.
> 
> Oops thanks for catching that. I guess I did not try building
> without CONFIG_GENERIC_PHY. Will fix and repost.

Did this series get lost/forgotten somewhere? Is it still needed? Any
way I can help?
Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


Re: [PATCH] scsi: ibmvscsi: Don't use rc uninitialized in ibmvscsi_do_work

2019-06-02 Thread Michael Ellerman
Hi Nathan,

Nathan Chancellor  writes:
> clang warns:
>
> drivers/scsi/ibmvscsi/ibmvscsi.c:2126:7: warning: variable 'rc' is used
> uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
> case IBMVSCSI_HOST_ACTION_NONE:
>  ^
> drivers/scsi/ibmvscsi/ibmvscsi.c:2151:6: note: uninitialized use occurs
> here
> if (rc) {
> ^~
>
> Initialize rc to zero so that the atomic_set and dev_err statement don't
> trigger for the cases that just break.
>
> Fixes: 035a3c4046b5 ("scsi: ibmvscsi: redo driver work thread to use enum 
> action states")
> Link: https://github.com/ClangBuiltLinux/linux/issues/502
> Signed-off-by: Nathan Chancellor 
> ---
>  drivers/scsi/ibmvscsi/ibmvscsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c 
> b/drivers/scsi/ibmvscsi/ibmvscsi.c
> index 727c31dc11a0..6714d8043e62 100644
> --- a/drivers/scsi/ibmvscsi/ibmvscsi.c
> +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
> @@ -2118,7 +2118,7 @@ static unsigned long ibmvscsi_get_desired_dma(struct 
> vio_dev *vdev)
>  static void ibmvscsi_do_work(struct ibmvscsi_host_data *hostdata)
>  {
>   unsigned long flags;
> - int rc;
> + int rc = 0;
>   char *action = "reset";
>  
>   spin_lock_irqsave(hostdata->host->host_lock, flags);

It's always preferable IMHO to keep any initialisation as localised as
possible, so that the compiler can continue to warn about uninitialised
usages elsewhere. In this case that would mean doing the rc = 0 in the
switch, something like:

diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 727c31dc11a0..7ee5755cf636 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -2123,9 +2123,6 @@ static void ibmvscsi_do_work(struct ibmvscsi_host_data 
*hostdata)
 
spin_lock_irqsave(hostdata->host->host_lock, flags);
switch (hostdata->action) {
-   case IBMVSCSI_HOST_ACTION_NONE:
-   case IBMVSCSI_HOST_ACTION_UNBLOCK:
-   break;
case IBMVSCSI_HOST_ACTION_RESET:
spin_unlock_irqrestore(hostdata->host->host_lock, flags);
rc = ibmvscsi_reset_crq_queue(&hostdata->queue, hostdata);
@@ -2142,7 +2139,10 @@ static void ibmvscsi_do_work(struct ibmvscsi_host_data 
*hostdata)
if (!rc)
rc = ibmvscsi_send_crq(hostdata, 0xC001LL, 
0);
break;
+   case IBMVSCSI_HOST_ACTION_NONE:
+   case IBMVSCSI_HOST_ACTION_UNBLOCK:
default:
+   rc = 0;
break;
}


But then that makes me wonder if that's actually correct?

If we get an action that we don't recognise should we just throw it away
like that? (by doing hostdata->action = IBMVSCSI_HOST_ACTION_NONE). Tyrel?

cheers


Re: [PATCH 1/2] phy: core: Add phy_pm_runtime_enabled

2019-06-02 Thread Pavel Machek
Hi!

> > > > @@ -240,6 +241,11 @@ static inline int phy_pm_runtime_put_sync(struct 
> > > > phy *phy)
> > > > return -ENOSYS;
> > > >  }
> > > >  
> > > > +static inline bool phy_pm_runtime_enabled(struct phy *phy)
> > > > +{
> > > > +   return false
> > > 
> > > Missing semicolon.
> > 
> > Oops thanks for catching that. I guess I did not try building
> > without CONFIG_GENERIC_PHY. Will fix and repost.
> 
> Did this series get lost/forgotten somewhere? Is it still needed? Any
> way I can help?

Aha, it seems v2 of the series was applied, which touches different
files and that's why I did not detect it. Sorry for the noise.

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


[PATCH v2 5/9] staging: rtl8712: Fixed CamelCase renames IsrContent to isr_content

2019-06-02 Thread Deepak Mishra
This patch fixes CamelCase IsrContent to isr_content as suggested by
checkpatch.pl

Signed-off-by: Deepak Mishra 
---
 drivers/staging/rtl8712/drv_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/drv_types.h 
b/drivers/staging/rtl8712/drv_types.h
index 5360f049088a..a5060a020b2b 100644
--- a/drivers/staging/rtl8712/drv_types.h
+++ b/drivers/staging/rtl8712/drv_types.h
@@ -148,7 +148,7 @@ struct _adapter {
booldriver_stopped;
boolsurprise_removed;
boolsuspended;
-   u32 IsrContent;
+   u32 isr_content;
u32 imr_content;
u8  eeprom_address_size;
u8  hw_init_completed;
-- 
2.19.1



[PATCH v2 6/9] staging: rtl8712: Fixed CamelCase renames xmitThread and recvThread

2019-06-02 Thread Deepak Mishra
This patch fixes CamelCase as reported by checkpatch.pl
xmitThread renamed to xmit_thread
recvThread renamed to recv_thread

Signed-off-by: Deepak Mishra 
---
 drivers/staging/rtl8712/drv_types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8712/drv_types.h 
b/drivers/staging/rtl8712/drv_types.h
index a5060a020b2b..1f8aa0358b77 100644
--- a/drivers/staging/rtl8712/drv_types.h
+++ b/drivers/staging/rtl8712/drv_types.h
@@ -154,8 +154,8 @@ struct _adapter {
u8  hw_init_completed;
struct task_struct *cmd_thread;
pid_t evt_thread;
-   struct task_struct *xmitThread;
-   pid_t recvThread;
+   struct task_struct *xmit_thread;
+   pid_t recv_thread;
uint (*dvobj_init)(struct _adapter *adapter);
void (*dvobj_deinit)(struct _adapter *adapter);
struct net_device *pnetdev;
-- 
2.19.1



[PATCH v2 3/9] staging: rtl8712: Fixed CamelCase cmdThread rename to cmd_thread

2019-06-02 Thread Deepak Mishra
This patch renames CamelCase cmdThread to cmd_thread in struct _adapter and 
related
files drv_types.h,os_intfs.c
CHECK: Avoid CamelCase: 

Signed-off-by: Deepak Mishra 
---
 drivers/staging/rtl8712/drv_types.h | 2 +-
 drivers/staging/rtl8712/os_intfs.c  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8712/drv_types.h 
b/drivers/staging/rtl8712/drv_types.h
index 7d1178278ecc..c6faafb13bdf 100644
--- a/drivers/staging/rtl8712/drv_types.h
+++ b/drivers/staging/rtl8712/drv_types.h
@@ -152,7 +152,7 @@ struct _adapter {
u32 imr_content;
u8  eeprom_address_size;
u8  hw_init_completed;
-   struct task_struct *cmdThread;
+   struct task_struct *cmd_thread;
pid_t evtThread;
struct task_struct *xmitThread;
pid_t recvThread;
diff --git a/drivers/staging/rtl8712/os_intfs.c 
b/drivers/staging/rtl8712/os_intfs.c
index c962696c9822..1653b36c4bfd 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -221,9 +221,9 @@ struct net_device *r8712_init_netdev(void)
 
 static u32 start_drv_threads(struct _adapter *padapter)
 {
-   padapter->cmdThread = kthread_run(r8712_cmd_thread, padapter, "%s",
+   padapter->cmd_thread = kthread_run(r8712_cmd_thread, padapter, "%s",
  padapter->pnetdev->name);
-   if (IS_ERR(padapter->cmdThread))
+   if (IS_ERR(padapter->cmd_thread))
return _FAIL;
return _SUCCESS;
 }
@@ -235,7 +235,7 @@ void r8712_stop_drv_threads(struct _adapter *padapter)
 
/*Below is to terminate r8712_cmd_thread & event_thread...*/
complete(&padapter->cmdpriv.cmd_queue_comp);
-   if (padapter->cmdThread)
+   if (padapter->cmd_thread)
wait_for_completion_interruptible(completion);
padapter->cmdpriv.cmd_seq = 1;
 }
-- 
2.19.1



[PATCH v2 1/9] staging: rtl8712: Fixed CamelCase rename ImrContent to imr_content

2019-06-02 Thread Deepak Mishra
This patch renames CamelCase ImrContent to imr_content in struct _adapter and 
related
files drv_types.h, rtl871x_mp_ioctl.c, rtl871x_pwrctrl.h

CHECK: Avoid CamelCase: 

Signed-off-by: Deepak Mishra 
---
 drivers/staging/rtl8712/drv_types.h| 2 +-
 drivers/staging/rtl8712/rtl871x_mp_ioctl.c | 2 +-
 drivers/staging/rtl8712/rtl871x_pwrctrl.h  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8712/drv_types.h 
b/drivers/staging/rtl8712/drv_types.h
index 9ae86631fa8b..89ebb5a49d25 100644
--- a/drivers/staging/rtl8712/drv_types.h
+++ b/drivers/staging/rtl8712/drv_types.h
@@ -149,7 +149,7 @@ struct _adapter {
boolsurprise_removed;
boolsuspended;
u32 IsrContent;
-   u32 ImrContent;
+   u32 imr_content;
u8  EepromAddressSize;
u8  hw_init_completed;
struct task_struct *cmdThread;
diff --git a/drivers/staging/rtl8712/rtl871x_mp_ioctl.c 
b/drivers/staging/rtl8712/rtl871x_mp_ioctl.c
index 588346da1412..4cf9d3afd2c5 100644
--- a/drivers/staging/rtl8712/rtl871x_mp_ioctl.c
+++ b/drivers/staging/rtl8712/rtl871x_mp_ioctl.c
@@ -665,7 +665,7 @@ uint oid_rt_pro_write_register_hdl(struct oid_par_priv 
*poid_par_priv)
if ((status == RNDIS_STATUS_SUCCESS) &&
(RegRWStruct->offset == HIMR) &&
(RegRWStruct->width == 4))
-   Adapter->ImrContent = RegRWStruct->value;
+   Adapter->imr_content = RegRWStruct->value;
}
return status;
 }
diff --git a/drivers/staging/rtl8712/rtl871x_pwrctrl.h 
b/drivers/staging/rtl8712/rtl871x_pwrctrl.h
index 11b5034f203d..cca81a3f4031 100644
--- a/drivers/staging/rtl8712/rtl871x_pwrctrl.h
+++ b/drivers/staging/rtl8712/rtl871x_pwrctrl.h
@@ -88,7 +88,7 @@ structpwrctrl_priv {
uint pwr_mode;
uint smart_ps;
uint alives;
-   uint ImrContent;/* used to store original imr. */
+   uint imr_content;   /* used to store original imr. */
uint bSleep; /* sleep -> active is different from active -> sleep. */
 
struct work_struct SetPSModeWorkItem;
-- 
2.19.1



[PATCH v2 7/9] staging: rtl8712: Fixed CamelCase wkFilterRxFF0 to wk_filter_rx_ff0 in

2019-06-02 Thread Deepak Mishra
This patch renames CamelCase variable wkFilterRxFF0 to wk_filter_rx_ff0
in drv_types.h and related files rtl871x_xmit.c and xmit_linux.c as
reported by checkpatch.pl

Signed-off-by: Deepak Mishra 
---
 drivers/staging/rtl8712/drv_types.h| 2 +-
 drivers/staging/rtl8712/rtl871x_xmit.c | 2 +-
 drivers/staging/rtl8712/xmit_linux.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8712/drv_types.h 
b/drivers/staging/rtl8712/drv_types.h
index 1f8aa0358b77..ddab6514a549 100644
--- a/drivers/staging/rtl8712/drv_types.h
+++ b/drivers/staging/rtl8712/drv_types.h
@@ -163,7 +163,7 @@ struct _adapter {
struct net_device_stats stats;
struct iw_statistics iwstats;
int pid; /*process id from UI*/
-   struct work_struct wkFilterRxFF0;
+   struct work_struct wk_filter_rx_ff0;
u8 blnEnableRxFF0Filter;
spinlock_t lockRxFF0Filter;
const struct firmware *fw;
diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c 
b/drivers/staging/rtl8712/rtl871x_xmit.c
index bfd5538a4652..5d63d2721eb6 100644
--- a/drivers/staging/rtl8712/rtl871x_xmit.c
+++ b/drivers/staging/rtl8712/rtl871x_xmit.c
@@ -139,7 +139,7 @@ sint _r8712_init_xmit_priv(struct xmit_priv *pxmitpriv,
pxmitbuf++;
}
pxmitpriv->free_xmitbuf_cnt = NR_XMITBUFF;
-   INIT_WORK(&padapter->wkFilterRxFF0, r8712_SetFilter);
+   INIT_WORK(&padapter->wk_filter_rx_ff0, r8712_SetFilter);
alloc_hwxmits(padapter);
init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
tasklet_init(&pxmitpriv->xmit_tasklet,
diff --git a/drivers/staging/rtl8712/xmit_linux.c 
b/drivers/staging/rtl8712/xmit_linux.c
index 8bcb0775411f..e65a51c7f372 100644
--- a/drivers/staging/rtl8712/xmit_linux.c
+++ b/drivers/staging/rtl8712/xmit_linux.c
@@ -94,7 +94,7 @@ void r8712_set_qos(struct pkt_file *ppktfile, struct 
pkt_attrib *pattrib)
 void r8712_SetFilter(struct work_struct *work)
 {
struct _adapter *padapter = container_of(work, struct _adapter,
-   wkFilterRxFF0);
+   wk_filter_rx_ff0);
u8  oldvalue = 0x00, newvalue = 0x00;
unsigned long irqL;
 
-- 
2.19.1



[PATCH v2 2/9] staging: rtl8712: Fixed CamelCase EepromAddressSize rename to eeprom_address_size

2019-06-02 Thread Deepak Mishra
This patch renames CamelCase EepromAddressSizefrom to eeprom_address_size in
struct _adapter and in related files drv_types.h, rtl871x_eeprom.c, usb_intf.c

CHECK: Avoid CamelCase: 

Signed-off-by: Deepak Mishra 
---
 drivers/staging/rtl8712/drv_types.h  | 2 +-
 drivers/staging/rtl8712/rtl871x_eeprom.c | 6 +++---
 drivers/staging/rtl8712/usb_intf.c   | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8712/drv_types.h 
b/drivers/staging/rtl8712/drv_types.h
index 89ebb5a49d25..7d1178278ecc 100644
--- a/drivers/staging/rtl8712/drv_types.h
+++ b/drivers/staging/rtl8712/drv_types.h
@@ -150,7 +150,7 @@ struct _adapter {
boolsuspended;
u32 IsrContent;
u32 imr_content;
-   u8  EepromAddressSize;
+   u8  eeprom_address_size;
u8  hw_init_completed;
struct task_struct *cmdThread;
pid_t evtThread;
diff --git a/drivers/staging/rtl8712/rtl871x_eeprom.c 
b/drivers/staging/rtl8712/rtl871x_eeprom.c
index 0027d8eb22fa..221bf92e1b1c 100644
--- a/drivers/staging/rtl8712/rtl871x_eeprom.c
+++ b/drivers/staging/rtl8712/rtl871x_eeprom.c
@@ -150,7 +150,7 @@ void r8712_eeprom_write16(struct _adapter *padapter, u16 
reg, u16 data)
x |= _EEM1 | _EECS;
r8712_write8(padapter, EE_9346CR, x);
shift_out_bits(padapter, EEPROM_EWEN_OPCODE, 5);
-   if (padapter->EepromAddressSize == 8)   /*CF+ and SDIO*/
+   if (padapter->eeprom_address_size == 8) /*CF+ and SDIO*/
shift_out_bits(padapter, 0, 6);
else/* USB */
shift_out_bits(padapter, 0, 4);
@@ -165,7 +165,7 @@ void r8712_eeprom_write16(struct _adapter *padapter, u16 
reg, u16 data)
 */
shift_out_bits(padapter, EEPROM_WRITE_OPCODE, 3);
/* select which word in the EEPROM that we are writing to. */
-   shift_out_bits(padapter, reg, padapter->EepromAddressSize);
+   shift_out_bits(padapter, reg, padapter->eeprom_address_size);
/* write the data to the selected EEPROM word. */
shift_out_bits(padapter, data, 16);
if (wait_eeprom_cmd_done(padapter)) {
@@ -207,7 +207,7 @@ u16 r8712_eeprom_read16(struct _adapter *padapter, u16 reg) 
/*ReadEEprom*/
 * The opcode is 3bits in length, reg is 6 bits long
 */
shift_out_bits(padapter, EEPROM_READ_OPCODE, 3);
-   shift_out_bits(padapter, reg, padapter->EepromAddressSize);
+   shift_out_bits(padapter, reg, padapter->eeprom_address_size);
/* Now read the data (16 bits) in from the selected EEPROM word */
data = shift_in_bits(padapter);
eeprom_clean(padapter);
diff --git a/drivers/staging/rtl8712/usb_intf.c 
b/drivers/staging/rtl8712/usb_intf.c
index 7478bbd3de78..200a271c28e1 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -246,7 +246,7 @@ static uint r8712_usb_dvobj_init(struct _adapter *padapter)
struct usb_device *pusbd = pdvobjpriv->pusbdev;
 
pdvobjpriv->padapter = padapter;
-   padapter->EepromAddressSize = 6;
+   padapter->eeprom_address_size = 6;
phost_iface = &pintf->altsetting[0];
piface_desc = &phost_iface->desc;
pdvobjpriv->nr_endpoint = piface_desc->bNumEndpoints;
-- 
2.19.1



[PATCH v2 0/9] staging: rtl8712: Fixed CamelCase in struct _adapter

2019-06-02 Thread Deepak Mishra
This patchset fixes CamelCase checks in struct _adapter in drv_types.h
and in files where struct _adapter is used by renaming the variables
without camel case.

These check were reported by checkpatch.pl

This patch also changes type of enable_rx_ff0_filter as bool

Deepak Mishra (9):
  staging: rtl8712: Fixed CamelCase rename ImrContent to imr_content
  staging: rtl8712: Fixed CamelCase EepromAddressSize rename to
eeprom_address_size
  staging: rtl8712: Fixed CamelCase cmdThread rename to cmd_thread
  staging: rtl8712: Fixed CamelCase renames evtThread to evt_thread
  staging: rtl8712: Fixed CamelCase renames IsrContent to isr_content
  staging: rtl8712: Fixed CamelCase renames xmitThread and recvThread
  staging: rtl8712: Fixed CamelCase wkFilterRxFF0 to wk_filter_rx_ff0 in
  staging: rtl8712: fixed enable_rx_ff0_filter as bool and CamelCase
  staging: rtl8712: Fixed CamelCase lockRxFF0Filter

 drivers/staging/rtl8712/drv_types.h| 20 ++--
 drivers/staging/rtl8712/os_intfs.c |  6 +++---
 drivers/staging/rtl8712/rtl871x_cmd.c  |  2 +-
 drivers/staging/rtl8712/rtl871x_eeprom.c   |  6 +++---
 drivers/staging/rtl8712/rtl871x_mp_ioctl.c |  2 +-
 drivers/staging/rtl8712/rtl871x_pwrctrl.h  |  2 +-
 drivers/staging/rtl8712/rtl871x_xmit.c |  2 +-
 drivers/staging/rtl8712/usb_intf.c |  4 ++--
 drivers/staging/rtl8712/xmit_linux.c   | 10 +-
 9 files changed, 27 insertions(+), 27 deletions(-)

-- 
2.19.1



[PATCH v2 9/9] staging: rtl8712: Fixed CamelCase lockRxFF0Filter

2019-06-02 Thread Deepak Mishra
This patch fixes CamelCase lockRxFF0Filter by renaming to
lock_rx_ff0_filter in drv_types.h and related files
usb_intf.c and xmit_linux.c

This was reported by checkpatch.pl

Signed-off-by: Deepak Mishra 
---
 drivers/staging/rtl8712/drv_types.h  | 2 +-
 drivers/staging/rtl8712/usb_intf.c   | 2 +-
 drivers/staging/rtl8712/xmit_linux.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8712/drv_types.h 
b/drivers/staging/rtl8712/drv_types.h
index e3e2b32e964e..087fad7a4433 100644
--- a/drivers/staging/rtl8712/drv_types.h
+++ b/drivers/staging/rtl8712/drv_types.h
@@ -165,7 +165,7 @@ struct _adapter {
int pid; /*process id from UI*/
struct work_struct wk_filter_rx_ff0;
bool enable_rx_ff0_filter;
-   spinlock_t lockRxFF0Filter;
+   spinlock_t lock_rx_ff0_filter;
const struct firmware *fw;
struct usb_interface *pusb_intf;
struct mutex mutex_start;
diff --git a/drivers/staging/rtl8712/usb_intf.c 
b/drivers/staging/rtl8712/usb_intf.c
index 200a271c28e1..d0daae0b8299 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -571,7 +571,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
/* step 6. Load the firmware asynchronously */
if (rtl871x_load_fw(padapter))
goto error;
-   spin_lock_init(&padapter->lockRxFF0Filter);
+   spin_lock_init(&padapter->lock_rx_ff0_filter);
mutex_init(&padapter->mutex_start);
return 0;
 error:
diff --git a/drivers/staging/rtl8712/xmit_linux.c 
b/drivers/staging/rtl8712/xmit_linux.c
index 9fa1abcf5e50..1b52be50c04c 100644
--- a/drivers/staging/rtl8712/xmit_linux.c
+++ b/drivers/staging/rtl8712/xmit_linux.c
@@ -102,9 +102,9 @@ void r8712_SetFilter(struct work_struct *work)
newvalue = oldvalue & 0xfe;
r8712_write8(padapter, 0x117, newvalue);
 
-   spin_lock_irqsave(&padapter->lockRxFF0Filter, irqL);
+   spin_lock_irqsave(&padapter->lock_rx_ff0_filter, irqL);
padapter->enable_rx_ff0_filter = true;
-   spin_unlock_irqrestore(&padapter->lockRxFF0Filter, irqL);
+   spin_unlock_irqrestore(&padapter->lock_rx_ff0_filter, irqL);
do {
msleep(100);
} while (padapter->enable_rx_ff0_filter == true);
-- 
2.19.1



[PATCH v2 8/9] staging: rtl8712: fixed enable_rx_ff0_filter as bool and CamelCase

2019-06-02 Thread Deepak Mishra
This patch fixes CamelCase blnEnableRxFF0Filter by renaming it
to enable_rx_ff0_filter in drv_types.h and related files rtl871x_cmd.c
xmit_linux.c
It was reported by checkpatch.pl

This fix also makes enable_rx_ff0_filter a bool and uses true false than
previously used u8 as suggested by j...@perches.com

Signed-off-by: Deepak Mishra 
---
 drivers/staging/rtl8712/drv_types.h   | 2 +-
 drivers/staging/rtl8712/rtl871x_cmd.c | 2 +-
 drivers/staging/rtl8712/xmit_linux.c  | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8712/drv_types.h 
b/drivers/staging/rtl8712/drv_types.h
index ddab6514a549..e3e2b32e964e 100644
--- a/drivers/staging/rtl8712/drv_types.h
+++ b/drivers/staging/rtl8712/drv_types.h
@@ -164,7 +164,7 @@ struct _adapter {
struct iw_statistics iwstats;
int pid; /*process id from UI*/
struct work_struct wk_filter_rx_ff0;
-   u8 blnEnableRxFF0Filter;
+   bool enable_rx_ff0_filter;
spinlock_t lockRxFF0Filter;
const struct firmware *fw;
struct usb_interface *pusb_intf;
diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c 
b/drivers/staging/rtl8712/rtl871x_cmd.c
index 05a78ac24987..6a8d58d97873 100644
--- a/drivers/staging/rtl8712/rtl871x_cmd.c
+++ b/drivers/staging/rtl8712/rtl871x_cmd.c
@@ -238,7 +238,7 @@ u8 r8712_sitesurvey_cmd(struct _adapter *padapter,
mod_timer(&pmlmepriv->scan_to_timer,
  jiffies + msecs_to_jiffies(SCANNING_TIMEOUT));
padapter->ledpriv.LedControlHandler(padapter, LED_CTL_SITE_SURVEY);
-   padapter->blnEnableRxFF0Filter = 0;
+   padapter->enable_rx_ff0_filter = false;
return _SUCCESS;
 }
 
diff --git a/drivers/staging/rtl8712/xmit_linux.c 
b/drivers/staging/rtl8712/xmit_linux.c
index e65a51c7f372..9fa1abcf5e50 100644
--- a/drivers/staging/rtl8712/xmit_linux.c
+++ b/drivers/staging/rtl8712/xmit_linux.c
@@ -103,11 +103,11 @@ void r8712_SetFilter(struct work_struct *work)
r8712_write8(padapter, 0x117, newvalue);
 
spin_lock_irqsave(&padapter->lockRxFF0Filter, irqL);
-   padapter->blnEnableRxFF0Filter = 1;
+   padapter->enable_rx_ff0_filter = true;
spin_unlock_irqrestore(&padapter->lockRxFF0Filter, irqL);
do {
msleep(100);
-   } while (padapter->blnEnableRxFF0Filter == 1);
+   } while (padapter->enable_rx_ff0_filter == true);
r8712_write8(padapter, 0x117, oldvalue);
 }
 
-- 
2.19.1



[PATCH v2 4/9] staging: rtl8712: Fixed CamelCase renames evtThread to evt_thread

2019-06-02 Thread Deepak Mishra
This patch fixes CamelCase renames evtThread to evt_thread in struct _adapter 
as reported by
checkpatch.pl
CHECK: Avoid CamelCase: 

Signed-off-by: Deepak Mishra 
---
 drivers/staging/rtl8712/drv_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/drv_types.h 
b/drivers/staging/rtl8712/drv_types.h
index c6faafb13bdf..5360f049088a 100644
--- a/drivers/staging/rtl8712/drv_types.h
+++ b/drivers/staging/rtl8712/drv_types.h
@@ -153,7 +153,7 @@ struct _adapter {
u8  eeprom_address_size;
u8  hw_init_completed;
struct task_struct *cmd_thread;
-   pid_t evtThread;
+   pid_t evt_thread;
struct task_struct *xmitThread;
pid_t recvThread;
uint (*dvobj_init)(struct _adapter *adapter);
-- 
2.19.1



Re: [PATCH v4] page cache: Store only head pages in i_pages

2019-06-02 Thread Matthew Wilcox
On Sat, Jun 01, 2019 at 12:44:28PM +0100, Chris Wilson wrote:
> Quoting Chris Wilson (2019-06-01 10:26:21)
> > Quoting Matthew Wilcox (2019-03-07 15:30:51)
> > > Transparent Huge Pages are currently stored in i_pages as pointers to
> > > consecutive subpages.  This patch changes that to storing consecutive
> > > pointers to the head page in preparation for storing huge pages more
> > > efficiently in i_pages.
> > > 
> > > Large parts of this are "inspired" by Kirill's patch
> > > https://lore.kernel.org/lkml/20170126115819.58875-2-kirill.shute...@linux.intel.com/
> > > 
> > > Signed-off-by: Matthew Wilcox 
> > > Acked-by: Jan Kara 
> > > Reviewed-by: Kirill Shutemov 
> > > Reviewed-and-tested-by: Song Liu 
> > > Tested-by: William Kucharski 
> > > Reviewed-by: William Kucharski 
> > 
> > I've bisected some new softlockups under THP mempressure to this patch.
> > They are all rcu stalls that look similar to:
> > [  242.645276] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
> > [  242.645293] rcu: Tasks blocked on level-0 rcu_node (CPUs 0-3): P828
> > [  242.645301]  (detected by 1, t=5252 jiffies, g=55501, q=221)
> > [  242.645307] gem_syslatency  R  running task0   828815 
> > 0x4000
> > [  242.645315] Call Trace:
> > [  242.645326]  ? __schedule+0x1a0/0x440
> > [  242.645332]  ? preempt_schedule_irq+0x27/0x50
> > [  242.645337]  ? apic_timer_interrupt+0xa/0x20
> > [  242.645342]  ? xas_load+0x3c/0x80
> > [  242.645347]  ? xas_load+0x8/0x80
> > [  242.645353]  ? find_get_entry+0x4f/0x130
> > [  242.645358]  ? pagecache_get_page+0x2b/0x210
> > [  242.645364]  ? lookup_swap_cache+0x42/0x100
> > [  242.645371]  ? do_swap_page+0x6f/0x600
> > [  242.645375]  ? unmap_region+0xc2/0xe0
> > [  242.645380]  ? __handle_mm_fault+0x7a9/0xfa0
> > [  242.645385]  ? handle_mm_fault+0xc2/0x1c0
> > [  242.645393]  ? __do_page_fault+0x198/0x410
> > [  242.645399]  ? page_fault+0x5/0x20
> > [  242.645404]  ? page_fault+0x1b/0x20
> > 
> > Any suggestions as to what information you might want?
> 
> Perhaps,
> [   76.175502] page:ea00098e count:0 mapcount:0 
> mapping: index:0x1
> [   76.175525] flags: 0x8000()
> [   76.175533] raw: 8000 ea0004a7e988 ea000445c3c8 
> 
> [   76.175538] raw: 0001   
> 
> [   76.175543] page dumped because: VM_BUG_ON_PAGE(entry != page)
> [   76.175560] [ cut here ]
> [   76.175564] kernel BUG at mm/swap_state.c:170!
> [   76.175574] invalid opcode:  [#1] PREEMPT SMP
> [   76.175581] CPU: 0 PID: 131 Comm: kswapd0 Tainted: G U
> 5.1.0+ #247
> [   76.175586] Hardware name:  /NUC6CAYB, BIOS 
> AYAPLCEL.86A.0029.2016.1124.1625 11/24/2016
> [   76.175598] RIP: 0010:__delete_from_swap_cache+0x22e/0x340
> [   76.175604] Code: e8 b7 3e fd ff 48 01 1d a8 7e 04 01 48 83 c4 30 5b 5d 41 
> 5c 41 5d 41 5e 41 5f c3 48 c7 c6 03 7e bf 81 48 89 c7 e8 92 f8 fd ff <0f> 0b 
> 48 c7 c6 c8 7c bf 81 48 89 df e8 81 f8 fd ff 0f 0b 48 c7 c6
> [   76.175613] RSP: :c98dba88 EFLAGS: 00010046
> [   76.175619] RAX: 0032 RBX: ea00098e0040 RCX: 
> 0006
> [   76.175624] RDX: 0007 RSI:  RDI: 
> 81bf6d4c
> [   76.175629] RBP: 888265ed8640 R08: 02c2 R09: 
> 
> [   76.175634] R10: 000273a4626d R11:  R12: 
> 0001
> [   76.175639] R13: 0040 R14:  R15: 
> ea00098e
> [   76.175645] FS:  () GS:888277a0() 
> knlGS:
> [   76.175651] CS:  0010 DS:  ES:  CR0: 80050033
> [   76.175656] CR2: 7f24e4399000 CR3: 02c09000 CR4: 
> 001406f0
> [   76.175661] Call Trace:
> [   76.175671]  __remove_mapping+0x1c2/0x380
> [   76.175678]  shrink_page_list+0x11db/0x1d10
> [   76.175684]  shrink_inactive_list+0x14b/0x420
> [   76.175690]  shrink_node_memcg+0x20e/0x740
> [   76.175696]  shrink_node+0xba/0x420
> [   76.175702]  balance_pgdat+0x27d/0x4d0
> [   76.175709]  kswapd+0x216/0x300
> [   76.175715]  ? wait_woken+0x80/0x80
> [   76.175721]  ? balance_pgdat+0x4d0/0x4d0
> [   76.175726]  kthread+0x106/0x120
> [   76.175732]  ? kthread_create_on_node+0x40/0x40
> [   76.175739]  ret_from_fork+0x1f/0x30
> [   76.175745] Modules linked in: i915 intel_gtt drm_kms_helper
> [   76.175754] ---[ end trace 8faf2ec849d50724 ]---
> [   76.206689] RIP: 0010:__delete_from_swap_cache+0x22e/0x340
> [   76.206708] Code: e8 b7 3e fd ff 48 01 1d a8 7e 04 01 48 83 c4 30 5b 5d 41 
> 5c 41 5d 41 5e 41 5f c3 48 c7 c6 03 7e bf 81 48 89 c7 e8 92 f8 fd ff <0f> 0b 
> 48 c7 c6 c8 7c bf 81 48 89 df e8 81 f8 fd ff 0f 0b 48 c7 c6
> [   76.206718] RSP: :c98dba88 EFLAGS: 00010046
> [   76.206723] RAX: 0032 RBX: ea00098e0040 RCX: 
> 0006
> [   76.206729] RDX: 0007 RSI:  

Re: [PATCH] net: sctp: fix memory leak in sctp_send_reset_streams

2019-06-02 Thread Neil Horman
On Sun, Jun 02, 2019 at 11:44:29AM +0800, Hillf Danton wrote:
> 
> syzbot found the following crash on:
> 
> HEAD commit:036e3431 Merge git://git.kernel.org/pub/scm/linux/kernel/g..
> git tree:   upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=153cff12a0
> kernel config:  https://syzkaller.appspot.com/x/.config?x=8f0f63a62bb5b13c
> dashboard link: https://syzkaller.appspot.com/bug?extid=6ad9c3bd0a218a2ab41d
> compiler:   gcc (GCC) 9.0.0 20181231 (experimental)
> syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=12561c86a0
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15b76fd8a0
> 
> executing program
> executing program
> executing program
> executing program
> executing program
> BUG: memory leak
> unreferenced object 0x888123894820 (size 32):
>   comm "syz-executor045", pid 7267, jiffies 4294943559 (age 13.660s)
>   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:
> [] kmemleak_alloc_recursive
> include/linux/kmemleak.h:55 [inline]
> [] slab_post_alloc_hook mm/slab.h:439 [inline]
> [] slab_alloc mm/slab.c:3326 [inline]
> [] __do_kmalloc mm/slab.c:3658 [inline]
> [] __kmalloc+0x161/0x2c0 mm/slab.c:3669
> [<3250ed8e>] kmalloc_array include/linux/slab.h:670 [inline]
> [<3250ed8e>] kcalloc include/linux/slab.h:681 [inline]
> [<3250ed8e>] sctp_send_reset_streams+0x1ab/0x5a0 
> net/sctp/stream.c:302
> [] sctp_setsockopt_reset_streams net/sctp/socket.c:4314 
> [inline]
> [] sctp_setsockopt net/sctp/socket.c:4765 [inline]
> [] sctp_setsockopt+0xc23/0x2bf0 net/sctp/socket.c:4608
> [] sock_common_setsockopt+0x38/0x50 net/core/sock.c:3130
> [<9eb87ae7>] __sys_setsockopt+0x98/0x120 net/socket.c:2078
> [] __do_sys_setsockopt net/socket.c:2089 [inline]
> [] __se_sys_setsockopt net/socket.c:2086 [inline]
> [] __x64_sys_setsockopt+0x26/0x30 net/socket.c:2086
> [] do_syscall_64+0x76/0x1a0 arch/x86/entry/common.c:301
> [] entry_SYSCALL_64_after_hwframe+0x44/0xa9
> 
> 
> It was introduced in commit d570a59c5b5f ("sctp: only allow the out stream
> reset when the stream outq is empty"), in orde to check stream outqs before
> sending SCTP_STRRESET_IN_PROGRESS back to the peer of the stream. EAGAIN is
> returned, however, without the nstr_list slab released, if any outq is found
> to be non empty.
> 
> Freeing the slab in question before bailing out fixes it.
> 
> Fixes: d570a59c5b5f ("sctp: only allow the out stream reset when the stream 
> outq is empty")
> Reported-by: syzbot 
> Reported-by: Marcelo Ricardo Leitner 
> Tested-by: Marcelo Ricardo Leitner 
> Cc: Xin Long 
> Cc: Neil Horman 
> Cc: Vlad Yasevich 
> Cc: Eric Dumazet 
> Signed-off-by: Hillf Danton 
> ---
> net/sctp/stream.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/net/sctp/stream.c b/net/sctp/stream.c
> index 93ed078..d3e2f03 100644
> --- a/net/sctp/stream.c
> +++ b/net/sctp/stream.c
> @@ -310,6 +310,7 @@ int sctp_send_reset_streams(struct sctp_association *asoc,
> 
>   if (out && !sctp_stream_outq_is_empty(stream, str_nums, nstr_list)) {
>   retval = -EAGAIN;
> + kfree(nstr_list);
>   goto out;
>   }
> 
> --
> 
> 
Acked-by: Neil Horman 


[GIT PULL] Please pull powerpc/linux.git powerpc-5.2-3 tag

2019-06-02 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Linus,

Please pull some more powerpc fixes for 5.2:

The following changes since commit a188339ca5a396acc588e5851ed7e19f66b0ebd9:

  Linux 5.2-rc1 (2019-05-19 15:47:09 -0700)

are available in the git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git 
tags/powerpc-5.2-3

for you to fetch changes up to 8b909e3548706cbebc0a676067b81aadda57f47e:

  powerpc/kexec: Fix loading of kernel + initramfs with kexec_file_load() 
(2019-05-23 14:00:32 +1000)

- --
powerpc fixes for 5.2 #3

A minor fix to our IMC PMU code to print a less confusing error message when the
driver can't initialise properly.

A fix for a bug where a user requesting an unsupported branch sampling filter
can corrupt PMU state, preventing the PMU from counting properly.

And finally a fix for a bug in our support for kexec_file_load(), which
prevented loading a kernel and initramfs. Most versions of kexec don't yet use
kexec_file_load().

Thanks to:
  Anju T Sudhakar, Dave Young, Madhavan Srinivasan, Ravi Bangoria, Thiago Jung
  Bauermann.

- --
Anju T Sudhakar (1):
  powerpc/powernv: Return for invalid IMC domain

Ravi Bangoria (1):
  powerpc/perf: Fix MMCRA corruption by bhrb_filter

Thiago Jung Bauermann (1):
  powerpc/kexec: Fix loading of kernel + initramfs with kexec_file_load()


 arch/powerpc/kernel/kexec_elf_64.c| 6 +-
 arch/powerpc/perf/core-book3s.c   | 6 --
 arch/powerpc/perf/power8-pmu.c| 3 +++
 arch/powerpc/perf/power9-pmu.c| 3 +++
 arch/powerpc/platforms/powernv/opal-imc.c | 4 
 5 files changed, 19 insertions(+), 3 deletions(-)
-BEGIN PGP SIGNATURE-

iQIcBAEBAgAGBQJc860sAAoJEFHr6jzI4aWAgk0QAJ7e67M/DrigLDIi5LdnwDQQ
AtQW+QzeoBHWiSgWfibqv5NjC9XCdOtvbOkD44TAlF99YMe5k8wShLLwiPSCIYEu
7r83+NHPp7jpeoO8fmE4dTJsmp4Ez+cJfOKpAF6h2w+1yJ5gL2AP5wNLUBi6Cliw
lUIRb73JgWj2hwu0HMNAxbE+mlyIpi8fXRk8TeUXVB+IEInOQxU0x/RkxqN4cCtG
f0hzAnZPywdDvRBuU6roPU3zrII7nVgrLUPXjgin/v58sdqR7zFnWnsm+ou0jkuy
K5zMcCuqZ6lrYjoak+OiqOt8CcalBtqju9ZANQkDIe5hMhXn4Maex1YbFE0i1UYm
Ljbm6Dp4dSTxQcx7GV1xMzHGNHEMQFKSABX+jF9l/KOVl4aVZAEz5F6DNKZO4lo+
EVX9HPBb6ZPyvwntLei8zn9C9LiSVWP5zsAW2zFam4isi498Ca1YpAyoSd58NrRn
WXVcDwMIp9c8uiQllbICNWdHzJhJWhUu/lW2idKFy05zG5+g6dg80StVpYlaEZwK
jggKwkD1H9VWrOZjoIHceOWPUxfjJ6wrvkovGqQqx6l9CkpEYfn1EG0p4s7CwXZ/
wEq0wVsfVaHPkEDSHSwg8mI9ZaEwoY6WMXE63WbVPNMWN26yw5vLJJx4o91Gk/wq
1F4UgNfF5XuQu8m5NWyU
=qxoS
-END PGP SIGNATURE-


Re: [GIT PULL] SPDX update for 5.2-rc3 - round 2

2019-06-02 Thread Masahiro Yamada
On Sun, Jun 2, 2019 at 4:17 PM Greg KH  wrote:
>
> The following changes since commit 2f4c53349961c8ca480193e47da4d44fdb8335a8:
>
>   Merge tag 'spdx-5.2-rc3-1' of 
> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core (2019-05-31 
> 08:34:32 -0700)
>
> are available in the Git repository at:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 
> tags/spdx-5.2-rc3-2
>
> for you to fetch changes up to 8e82fe2ab65a80b1526b285c661ab88cc5891e3a:
>
>   treewide: fix typos of SPDX-License-Identifier (2019-06-01 18:29:58 +0200)
>
> 
> SPDX fixes for 5.2-rc3, round 2
>
> Here are just two small patches, that fix up some found SPDX identifier
> issues.
>
> The first patch fixes an error in a previous SPDX fixup patch, that
> causes build errors when doing 'make clean' on the tree (the fact that
> almost no one noticed it reflects the fact that kernel developers don't
> like doing that option very often...)

This paragraph is not precise.

Not only "make clean", but also the normal build is broken.
In fact, ARCH=arm allmodconfig is broken.


$ make -j8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- allmodconfig
  [ snip ]
$ make -j8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
  [ snip ]
drivers/crypto/ux500/cryp/Makefile:5: *** missing separator.  Stop.
make[3]: *** [scripts/Makefile.build;489: drivers/crypto/ux500/cryp] Error 2
make[2]: *** [scripts/Makefile.build;489: drivers/crypto/ux500] Error 2
make[1]: *** [scripts/Makefile.build;489: drivers/crypto] Error 2
make[1]: *** Waiting for unfinished jobs



The 0-day bot should check allmodconfig for all arches,
but surprisingly it was not caught before the merge.



> The second patch fixes up a number of places in the tree where people
> mistyped the string "SPDX-License-Identifier".  Given that people can
> not even type their own name all the time without mistakes, this was
> bound to happen, and odds are, we will have to add some type of check
> for this to checkpatch.pl to catch this happening in the future.

checkpatch.pl already warns
"Missing or malformed SPDX-License-Identifier tag"
unless correctly typed "SPDX-License-Identifier" is found in the file.

No more check is needed for this, I think.

Not all developers run scripts/checkpatch.pl before patch submission.
Not all maintainers run scripts/checkpatch.pl before commit.

Thanks.


> Both of these have passed testing by 0-day.
>
> Signed-off-by: Greg Kroah-Hartman 
>
> 
> Alex Xu (Hello71) (1):
>   crypto: ux500 - fix license comment syntax error
>
> Masahiro Yamada (1):
>   treewide: fix typos of SPDX-License-Identifier
>
>  arch/arm/kernel/bugs.c| 2 +-
>  drivers/crypto/ux500/cryp/Makefile| 2 +-
>  drivers/phy/st/phy-stm32-usbphyc.c| 2 +-
>  drivers/pinctrl/sh-pfc/pfc-r8a77980.c | 2 +-
>  lib/test_stackinit.c  | 2 +-
>  sound/soc/codecs/max9759.c| 2 +-
>  6 files changed, 6 insertions(+), 6 deletions(-)



-- 
Best Regards
Masahiro Yamada


Re: [RFC 2/6] ipv4: add lockdep condition to fix for_each_entry

2019-06-02 Thread Joel Fernandes
On Sun, Jun 2, 2019 at 3:00 AM Pavel Machek  wrote:
>
> On Sat 2019-06-01 18:27:34, Joel Fernandes (Google) wrote:
> > Signed-off-by: Joel Fernandes (Google) 
>
> This really needs to be merged to previous patch, you can't break
> compilation in middle of series...
>
> Or probably you need hlist_for_each_entry_rcu_lockdep() macro with
> additional argument, and switch users to it.

Good point. I can also just add a temporary transition macro, and then
remove it in the last patch. That way no new macro is needed.

Thanks!


Re: [RFC 2/6] ipv4: add lockdep condition to fix for_each_entry

2019-06-02 Thread Joel Fernandes
On Sun, Jun 2, 2019 at 8:20 AM Joel Fernandes  wrote:
>
> On Sun, Jun 2, 2019 at 3:00 AM Pavel Machek  wrote:
> >
> > On Sat 2019-06-01 18:27:34, Joel Fernandes (Google) wrote:
> > > Signed-off-by: Joel Fernandes (Google) 
> >
> > This really needs to be merged to previous patch, you can't break
> > compilation in middle of series...
> >
> > Or probably you need hlist_for_each_entry_rcu_lockdep() macro with
> > additional argument, and switch users to it.
>
> Good point. I can also just add a temporary transition macro, and then
> remove it in the last patch. That way no new macro is needed.

Actually, no. There is no compilation break so I did not follow what
you mean. The fourth argument to the hlist_for_each_entry_rcu is
optional. The only thing that happens is new lockdep warnings will
arise which later parts of the series fix by passing in that fourth
argument.


Re: [PATCH v4] page cache: Store only head pages in i_pages

2019-06-02 Thread Chris Wilson
Quoting Matthew Wilcox (2019-06-02 11:51:50)
> Thanks for the reports, Chris.
> 
> I think they're both canaries; somehow the page cache / swap cache has
> got corrupted and contains entries that it shouldn't.
> 
> This second one (with the VM_BUG_ON_PAGE in __delete_from_swap_cache)
> shows a regular (non-huge) page at index 1.  There are two ways we might
> have got there; one is that we asked to delete a page at index 1 which is
> no longer in the cache.  The other is that we asked to delete a huge page
> at index 0, but the page wasn't subsequently stored in indices 1-511.
> 
> We dump the page that we found; not the page we're looking for, so I don't
> know which.  If this one's easy to reproduce, you could add:
> 
> for (i = 0; i < nr; i++) {
> void *entry = xas_store(&xas, NULL);
> +   if (entry != page) {
> +   printk("Oh dear %d %d\n", i, nr);
> +   dump_page(page, "deleting page");
> +   }

[  113.423120] Oh dear 0 1
[  113.423141] page:ea000911cdc0 refcount:0 mapcount:0 
mapping:88826aee7bb1 index:0x7fce6ff37
[  113.423146] anon
[  113.423150] flags: 
0x80080445(locked|uptodate|workingset|owner_priv_1|swapbacked)
[  113.423161] raw: 80080445 dead0100 dead0200 
88826aee7bb1
[  113.423167] raw: 0007fce6ff37 00054537  

[  113.423171] page dumped because: deleting page
[  113.423176] page:ea0009118000 refcount:1 mapcount:0 
mapping:88826aee7bb1 index:0x7fce6fe00
[  113.423182] anon
[  113.423183] flags: 
0x80080454(uptodate|lru|workingset|owner_priv_1|swapbacked)
[  113.423191] raw: 80080454 ea0009118048 ea000911ce08 
88826aee7bb1
[  113.423198] raw: 0007fce6fe00 00054400 0001 
8882693e5000
[  113.423204] page dumped because: VM_BUG_ON_PAGE(entry != page)
[  113.423209] page->mem_cgroup:8882693e5000
[  113.423222] [ cut here ]
[  113.423227] kernel BUG at mm/swap_state.c:174!
[  113.423236] invalid opcode:  [#1] PREEMPT SMP DEBUG_PAGEALLOC
[  113.423243] CPU: 1 PID: 131 Comm: kswapd0 Tainted: G U
5.2.0-rc2+ #251
[  113.423248] Hardware name:  /NUC6CAYB, BIOS AYAPLCEL.86A.0029.2016.1124.1625 
11/24/2016
[  113.423260] RIP: 0010:__delete_from_swap_cache.cold.17+0x30/0x36
[  113.423265] Code: 48 c7 c7 13 94 bf 81 e8 cd 7f f3 ff 48 89 df 48 c7 c6 24 
94 bf 81 e8 95 6c fd ff 48 c7 c6 32 94 bf 81 4c 89 ff e8 86 6c fd ff <0f> 0b 90 
90 90 90 48 8b 07 48 8b 16 48 c1 e8 3a 48 c1 ea 3a 29 d0
[  113.423274] RSP: 0018:c98b3a80 EFLAGS: 00010046
[  113.423280] RAX:  RBX: ea000911cdc0 RCX: 0006
[  113.423285] RDX: 0007 RSI: 0092 RDI: 888276c963c0
[  113.423290] RBP: 888265a98d20 R08: 02ce R09: 
[  113.423296] R10: 000272bc445c R11:  R12: 0001
[  113.423301] R13:  R14:  R15: ea0009118000
[  113.423306] FS:  () GS:888276c8() 
knlGS:
[  113.423313] CS:  0010 DS:  ES:  CR0: 80050033
[  113.423317] CR2: 7fce7c857000 CR3: 02c09000 CR4: 001406e0
[  113.423323] Call Trace:
[  113.423331]  __remove_mapping+0x1c2/0x380
[  113.423337]  shrink_page_list+0x123c/0x1d00
[  113.423343]  shrink_inactive_list+0x130/0x300
[  113.423348]  shrink_node_memcg+0x20e/0x740
[  113.423354]  shrink_node+0xba/0x420
[  113.423359]  balance_pgdat+0x27d/0x4d0
[  113.423365]  kswapd+0x216/0x300
[  113.423372]  ? wait_woken+0x80/0x80
[  113.423378]  ? balance_pgdat+0x4d0/0x4d0
[  113.423384]  kthread+0x106/0x120
[  113.423389]  ? kthread_create_on_node+0x40/0x40
[  113.423398]  ret_from_fork+0x1f/0x30
[  113.423405] Modules linked in: i915 intel_gtt drm_kms_helper
[  113.423414] ---[ end trace 328930613dd77e06 ]---
[  113.454546] RIP: 0010:__delete_from_swap_cache.cold.17+0x30/0x36

> VM_BUG_ON_PAGE(entry != page, entry);
> set_page_private(page + i, 0);
> xas_next(&xas);
> }
> 
> I'll re-read the patch and see if I can figure out how the cache is getting
> screwed up.  Given what you said, probably on the swap-in path.

It may be self-incriminating, but this only occurs when i915.ko is also
involved via shrink_slab.
-Chris


[PATCH v3] i2c: i801: Register optional lis3lv02d i2c device on Dell machines

2019-06-02 Thread Pali Rohár
Dell platform team told us that some (DMI whitelisted) Dell Latitude
machines have ST microelectronics accelerometer at i2c address 0x29.

Presence of that ST microelectronics accelerometer is verified by existence
of SMO88xx ACPI device which represent that accelerometer. Unfortunately
ACPI device does not specify i2c address.

This patch registers lis3lv02d device for selected Dell Latitude machines
at i2c address 0x29 after detection. And for Dell Vostro V131 machine at
i2c address 0x1d which was manually detected.

Finally commit a7ae81952cda ("i2c: i801: Allow ACPI SystemIO OpRegion to
conflict with PCI BAR") allowed to use i2c-i801 driver on Dell machines so
lis3lv02d correctly initialize accelerometer.

Tested on Dell Latitude E6440.

Signed-off-by: Pali Rohár 

---
Changes since v2:
 * Use explicit list of SMOxx ACPI devices

Changes since v1:
 * Added Dell Vostro V131 based on Michał Kępień testing
 * Changed DMI product structure to include also i2c address
---
 drivers/i2c/busses/i2c-i801.c   | 118 
 drivers/platform/x86/dell-smo8800.c |   1 +
 2 files changed, 119 insertions(+)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index ac7f7817dc89..2ac8ff41cc24 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1134,6 +1134,121 @@ static void dmi_check_onboard_devices(const struct 
dmi_header *dm, void *adap)
}
 }
 
+/* NOTE: Keep this list in sync with drivers/platform/x86/dell-smo8800.c */
+static const struct acpi_device_id acpi_smo8800_ids[] = {
+   { "SMO8800", 0 },
+   { "SMO8801", 0 },
+   { "SMO8810", 0 },
+   { "SMO8811", 0 },
+   { "SMO8820", 0 },
+   { "SMO8821", 0 },
+   { "SMO8830", 0 },
+   { "SMO8831", 0 },
+};
+
+static acpi_status check_acpi_smo88xx_device(acpi_handle obj_handle,
+u32 nesting_level,
+void *context,
+void **return_value)
+{
+   struct acpi_device_info *info;
+   acpi_status status;
+   char *hid;
+   int i;
+
+   status = acpi_get_object_info(obj_handle, &info);
+   if (!ACPI_SUCCESS(status) || !(info->valid & ACPI_VALID_HID))
+   return AE_OK;
+
+   hid = info->hardware_id.string;
+   if (!hid)
+   return AE_OK;
+
+   for (i = 0; i < ARRAY_SIZE(acpi_smo8800_ids); ++i) {
+   if (strcmp(hid, acpi_smo8800_ids[i].id) == 0) {
+   *((bool *)return_value) = true;
+   return AE_CTRL_TERMINATE;
+   }
+   }
+
+   return AE_OK;
+
+}
+
+static bool is_dell_system_with_lis3lv02d(void)
+{
+   bool found;
+   acpi_status status;
+   const char *vendor;
+
+   vendor = dmi_get_system_info(DMI_SYS_VENDOR);
+   if (strcmp(vendor, "Dell Inc.") != 0)
+   return false;
+
+   /*
+* Check that ACPI device SMO88xx exists and is enabled. That ACPI
+* device represent our ST microelectronics lis3lv02d accelerometer but
+* unfortunately without any other information (like i2c address).
+*/
+   found = false;
+   status = acpi_get_devices(NULL, check_acpi_smo88xx_device, NULL,
+ (void **)&found);
+   if (!ACPI_SUCCESS(status) || !found)
+   return false;
+
+   return true;
+}
+
+/*
+ * Accelerometer's i2c address is not specified in DMI nor ACPI,
+ * so it is needed to define mapping table based on DMI product names.
+ */
+static struct {
+   const char *dmi_product_name;
+   unsigned short i2c_addr;
+} dell_lis3lv02d_devices[] = {
+   /*
+* Dell platform team told us that these Latitude devices have
+* ST microelectronics accelerometer at i2c address 0x29.
+*/
+   { "Latitude E5250", 0x29 },
+   { "Latitude E5450", 0x29 },
+   { "Latitude E5550", 0x29 },
+   { "Latitude E6440", 0x29 },
+   { "Latitude E6440 ATG", 0x29 },
+   { "Latitude E6540", 0x29 },
+   /*
+* Additional individual entries were added after verification.
+*/
+   { "Vostro V131",0x1d },
+};
+
+static void register_dell_lis3lv02d_i2c_device(struct i801_priv *priv)
+{
+   struct i2c_board_info info;
+   const char *dmi_product_name;
+   int i;
+
+   dmi_product_name = dmi_get_system_info(DMI_PRODUCT_NAME);
+   for (i = 0; i < ARRAY_SIZE(dell_lis3lv02d_devices); ++i) {
+   if (strcmp(dmi_product_name,
+  dell_lis3lv02d_devices[i].dmi_product_name) == 0)
+   break;
+   }
+
+   if (i == ARRAY_SIZE(dell_lis3lv02d_devices)) {
+   dev_warn(&priv->pci_dev->dev,
+"Accelerometer lis3lv02d is present on i2c bus but its"
+" i2c address is unknown, skipping registrat

Re: [PATCH] net: sctp: fix memory leak in sctp_send_reset_streams

2019-06-02 Thread Xin Long
On Sun, Jun 2, 2019 at 6:52 PM Neil Horman  wrote:
>
> On Sun, Jun 02, 2019 at 11:44:29AM +0800, Hillf Danton wrote:
> >
> > syzbot found the following crash on:
> >
> > HEAD commit:036e3431 Merge git://git.kernel.org/pub/scm/linux/kernel/g..
> > git tree:   upstream
> > console output: https://syzkaller.appspot.com/x/log.txt?x=153cff12a0
> > kernel config:  https://syzkaller.appspot.com/x/.config?x=8f0f63a62bb5b13c
> > dashboard link: https://syzkaller.appspot.com/bug?extid=6ad9c3bd0a218a2ab41d
> > compiler:   gcc (GCC) 9.0.0 20181231 (experimental)
> > syz repro:  https://syzkaller.appspot.com/x/repro.syz?x=12561c86a0
> > C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15b76fd8a0
> >
> > executing program
> > executing program
> > executing program
> > executing program
> > executing program
> > BUG: memory leak
> > unreferenced object 0x888123894820 (size 32):
> >   comm "syz-executor045", pid 7267, jiffies 4294943559 (age 13.660s)
> >   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:
> > [] kmemleak_alloc_recursive
> > include/linux/kmemleak.h:55 [inline]
> > [] slab_post_alloc_hook mm/slab.h:439 [inline]
> > [] slab_alloc mm/slab.c:3326 [inline]
> > [] __do_kmalloc mm/slab.c:3658 [inline]
> > [] __kmalloc+0x161/0x2c0 mm/slab.c:3669
> > [<3250ed8e>] kmalloc_array include/linux/slab.h:670 [inline]
> > [<3250ed8e>] kcalloc include/linux/slab.h:681 [inline]
> > [<3250ed8e>] sctp_send_reset_streams+0x1ab/0x5a0 
> > net/sctp/stream.c:302
> > [] sctp_setsockopt_reset_streams 
> > net/sctp/socket.c:4314 [inline]
> > [] sctp_setsockopt net/sctp/socket.c:4765 [inline]
> > [] sctp_setsockopt+0xc23/0x2bf0 net/sctp/socket.c:4608
> > [] sock_common_setsockopt+0x38/0x50 
> > net/core/sock.c:3130
> > [<9eb87ae7>] __sys_setsockopt+0x98/0x120 net/socket.c:2078
> > [] __do_sys_setsockopt net/socket.c:2089 [inline]
> > [] __se_sys_setsockopt net/socket.c:2086 [inline]
> > [] __x64_sys_setsockopt+0x26/0x30 net/socket.c:2086
> > [] do_syscall_64+0x76/0x1a0 
> > arch/x86/entry/common.c:301
> > [] entry_SYSCALL_64_after_hwframe+0x44/0xa9
> >
> >
> > It was introduced in commit d570a59c5b5f ("sctp: only allow the out stream
> > reset when the stream outq is empty"), in orde to check stream outqs before
> > sending SCTP_STRRESET_IN_PROGRESS back to the peer of the stream. EAGAIN is
> > returned, however, without the nstr_list slab released, if any outq is found
> > to be non empty.
> >
> > Freeing the slab in question before bailing out fixes it.
> >
> > Fixes: d570a59c5b5f ("sctp: only allow the out stream reset when the stream 
> > outq is empty")
> > Reported-by: syzbot 
> > Reported-by: Marcelo Ricardo Leitner 
> > Tested-by: Marcelo Ricardo Leitner 
> > Cc: Xin Long 
> > Cc: Neil Horman 
> > Cc: Vlad Yasevich 
> > Cc: Eric Dumazet 
> > Signed-off-by: Hillf Danton 
> > ---
> > net/sctp/stream.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/net/sctp/stream.c b/net/sctp/stream.c
> > index 93ed078..d3e2f03 100644
> > --- a/net/sctp/stream.c
> > +++ b/net/sctp/stream.c
> > @@ -310,6 +310,7 @@ int sctp_send_reset_streams(struct sctp_association 
> > *asoc,
> >
> >   if (out && !sctp_stream_outq_is_empty(stream, str_nums, nstr_list)) {
> >   retval = -EAGAIN;
> > + kfree(nstr_list);
> >   goto out;
> >   }
> >
> > --
> >
> >
> Acked-by: Neil Horman 
Reviewed-by: Xin Long 


Re: [PATCH v3 1/2] gpio: Add support for hierarchical IRQ domains

2019-06-02 Thread Linus Walleij
On Wed, May 29, 2019 at 4:53 PM Thierry Reding  wrote:

> From: Thierry Reding 
>
> Hierarchical IRQ domains can be used to stack different IRQ controllers
> on top of each other. One specific use-case where this can be useful is
> if a power management controller has top-level controls for wakeup
> interrupts. In such cases, the power management controller can be a
> parent to other interrupt controllers and program additional registers
> when an IRQ has its wake capability enabled or disabled.
>
> Signed-off-by: Thierry Reding 
> ---
> Changes in v3:
> - use irq_create_fwspec_mapping() instead of irq_domain_alloc_irqs()
> - add missing kerneldoc for new parent_domain field
> - keep IRQ_DOMAIN dependency for clarity
>
> Changes in v2:
> - select IRQ_DOMAIN_HIERARCHY to avoid build failure
> - move more code into the gpiolib core

This is looking really good!

>  config GPIOLIB_IRQCHIP
> select IRQ_DOMAIN
> +   select IRQ_DOMAIN_HIERARCHY
> bool

Hm OK I guess. It would be ugly to ifdef all hierarchy
code in gpiolib.

>  static int gpiochip_to_irq(struct gpio_chip *chip, unsigned offset)
>  {
> +   struct irq_domain *domain = chip->irq.domain;
> +
> if (!gpiochip_irqchip_irq_valid(chip, offset))
> return -ENXIO;
>
> +   if (irq_domain_is_hierarchy(domain)) {
> +   struct irq_fwspec spec;
> +
> +   spec.fwnode = domain->fwnode;
> +   spec.param_count = 2;
> +   spec.param[0] = offset;
> +   spec.param[1] = IRQ_TYPE_NONE;
> +
> +   return irq_create_fwspec_mapping(&spec);
> +   }
> +
> return irq_create_mapping(chip->irq.domain, offset);

This is looking really good!

> +   /*
> +* Allow GPIO chips to override the ->to_irq() if they really need to.
> +* This should only be very rarely needed, the majority should be fine
> +* with gpiochip_to_irq().
> +*/
> +   if (!gpiochip->to_irq)
> +   gpiochip->to_irq = gpiochip_to_irq;

Please drop this. The default .to_irq() should be good for everyone.
Also patch 2/2 now contains a identical copy of the gpiolib
.to_irq() which I suspect you indended to drop, actually.

Other than that I'm ready to merge the v3 of this!

Yours,
Linus Walleij


Re: iwl_mvm_add_new_dqa_stream_wk BUG in lib/list_debug.c:56

2019-06-02 Thread Marc Haber
On Thu, May 30, 2019 at 10:12:57AM +0200, Marc Haber wrote:
> on my primary notebook, a Lenovo X260, with an Intel Wireless 8260
> (8086:24f3), running Debian unstable, I have started to see network
> hangs since upgrading to kernel 5.1. In this situation, I cannot
> restart Network-Manager (the call just hangs), I can log out of X, but
> the system does not cleanly shut down and I need to Magic SysRq myself
> out of the running system. This happens about once every two days.

The issue is also present in 5.1.5 and 5.1.6.

Greetings
Marc

-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany|  lose things."Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421


Re: [PATCH v3 1/2] gpio: Add support for hierarchical IRQ domains

2019-06-02 Thread Linus Walleij
On Wed, May 29, 2019 at 4:53 PM Thierry Reding  wrote:

> From: Thierry Reding 
>
> Hierarchical IRQ domains can be used to stack different IRQ controllers
> on top of each other. One specific use-case where this can be useful is
> if a power management controller has top-level controls for wakeup
> interrupts. In such cases, the power management controller can be a
> parent to other interrupt controllers and program additional registers
> when an IRQ has its wake capability enabled or disabled.
>
> Signed-off-by: Thierry Reding 
> ---
> Changes in v3:
> - use irq_create_fwspec_mapping() instead of irq_domain_alloc_irqs()
> - add missing kerneldoc for new parent_domain field
> - keep IRQ_DOMAIN dependency for clarity

Actually I applied the patch, and dropped the two lines making
it possible to override .to_irq() for now, so I can illustrate my
idea on top. If I manage.

Yours,
Linus Walleij


Oasis Fair Streams O-S: The Philosophy Behind - To Those It May Concern

2019-06-02 Thread Ywe Cærlyn
I think I´ve said most things about what I am doing to LKML now.

A correctly experienced will know much about his system and the design will not 
go much from original idea.
Which is what we see with Unix. I think this was the point of its original 
developers aswell, and a commentary on corporate mismanagement being "Plan 9 
from Outer Space".

And Irix was an early desktop version, that influenced extremely popular 
computers like CBM, and one may want to go somewhere between, aiming for a 
replacement of the CBM LSD-god, that also was its demise, which we ofcourse 
still see in difficult persons like Richard Stallman, who claimed the Available 
Source of Unix, was his invention, and started his own project "GNU Is Not 
Unix", dancing lsd-god dances, and iterating one-line pseudo-religion. 
Psychosis ofcourse really is this, prolonged use of narcotics, such as Amanita, 
Opiates, or other hallucinatory drugs, and even worse claim it is a religious 
god! So not surprisingly "Psychosis". Also known as "The Difficult Wino 
Problem". Psychiatry cannot reform such persons though, and it is vanity to 
think so. Rather the punishments of Islam, seems more appropriate, where false 
gods is the capital crime.

And why the now little succesful Linux, compared to the original Unix 
derivative BSD as now used in MacOS for quite a while. Why not just take BSD 
further, and the original Unix source,  instead of being with the "Linux 
zealots", with discussed behavioural problems - the KNU (Krazy GNU User). I am 
sure any experienced person here easily could apply his patching on BSD aswell, 
coming to more fruitition here, and Mac OS. And such solve any forthcoming 
debate, after the Stallmanic fog, when it lifts ofcourse his dances and "GNU Is 
Not Unix" nonsense and claims of having something to do with Available Source 
would seem problematic.

With his claims of "hackership", and being a "programmer", questionable since 
he claimed this for a very long time but never managed to make a kernel 
himself. The original hackers on Bell Labs, did ofcourse make the original Unix 
kernel also, and he is clearly not a "hacker" in this sense. And "his" 
compiler, have options like "wait for pop" on, even though "ricer" (unecessary 
optimization options) have been discussed with supposedly concluding that such 
things are not necessary. With the "GNU" brainwashed putting 10ms timers into 
sched.c, for measuring CPU use, when at 10ms point, most in the computer has 
already happened! And Linus suggests 1000hz  timer, when I myself find 90hz 
timer to be optimal, more like modest BSD settings. Hacker really referring the 
hacking sound of a typewriter, rather than any maniac GNU LSD version. To not 
speak of the horrible pointer variables in LADSPA. Did Linux even come much 
beyond Soundblaster mindset of the early 90s? Here the BSD based Mac OS, has 
modern hardware and Logic Audio - a fully professional platform used by actual 
artists, rather than "noisebient artists" in Linux crowds.

And to be honest, on the windows side things are still the same, it has similar 
problems as it had since Windows 95, and never really got good did it. It even 
still does not have proper priorities of threads! And the multimedia crowd 
always found it to be obscure. Here ofcourse also vanity in claiming a 
different design than the original Unix, that already did design the groundwork 
for modern OS's. A good thing is ofcourse Microsoft in these days, opening up 
to more of Unix.

As indeed Mac did. Running in 4K, with Itunes and Mini formfactor. If everyone 
goes well with Mac, one might aswell just do the Mac thing, with Logic Audio 
and all. Maybe they would make OS-X Oasis? We are there if it slows down and 
becomes Windows like.

Indie composition goes all the way back to C64 as a midi sequencer. The 
acidhouse phenomena was big on computers, and pop-culture and CBM-culture 
seemed intertwined in the 90s, where a Trance musician might just be a 
researcher otherwise. That is a long time with music and thinking. I myself 
have concluded  with -10dB RMS masters, 96K processing (80bit for feedback 
paths) and polyphase interpolation, and will promote that. And could even be in 
a horizontal tracker app, for those wanting that, and polyphase interpolation 
does not guess points like a regular interpolator, but rather upsamples, and 
filters the aliases, adding no guesswork to the dataset, and a more probably 
reconstruction than guessing interpolators and its interpolation error, and is 
like an original variable DAC, that did not guess either, but was popular in 
the 80s/90s probably for that reason, just with modern conveniences such as 
alias filtering.

There seems to be a lot of expertise out there. So why waste it on Linux? In 
CBM days, expertise seemed more typical also, and LKML debates claim to be 
this. Why not just take BSD further. With "cyberspace" indeed could need a 
graphical 4K/8K subpixel update itself in these days.

The 

Re: [PATCH -next] pwm: pca9685: Remove set but not used variable 'pwm'

2019-06-02 Thread Sven Van Asbroeck
On Sat, Jun 1, 2019 at 12:05 PM Uwe Kleine-König
 wrote:
>
> I didn't look into the driver to try to understand that, but the
> definitely needs a comment to explain for the next person to think they
> can do a cleanup here.

Certainly.

But if we do restore the old behaviour, there may still be problems.
I'm unsure if the old synchronization was working correctly.
See the example at the end of this email.

An intuitive way forward would be to use a simple bitfield in
struct pca9685 to track if a specific pwm is in use by either
pwm or gpio. Protected by a mutex.

But it could be that the old behaviour is 'good enough' for
the driver's users (I am no longer one of them).

===

Let's take the example of two threads, racing to grab a pwm and gpio,
respectively. Assume the gpio is backed by the pwm, so they conflict.

[Thread 1]
drivers/pwm/core.c:

if (pwm->chip->ops->request) {
err = pwm->chip->ops->request(pwm->chip, pwm);
[this calls pca9685_pwm_request()]
[which calls pca9685_pwm_is_gpio()]
[checks pwm chip_data, is NULL, pwm is free]
[returns 0 - pwm request ok]
if (err) {
module_put(pwm->chip->ops->owner);
return err;
}
}

[CONTEXT SWITCH to Thread 2]
static int pca9685_pwm_gpio_request(struct gpio_chip *gpio,
unsigned int offset)
{
struct pca9685 *pca = gpiochip_get_data(gpio);
struct pwm_device *pwm;

mutex_lock(&pca->lock);

pwm = &pca->chip.pwms[offset];

[pwm->flags do not (yet) have PWMF_REQUESTED]
if (pwm->flags & (PWMF_REQUESTED | PWMF_EXPORTED)) {
mutex_unlock(&pca->lock);
return -EBUSY;
}

pwm_set_chip_data(pwm, (void *)1);

mutex_unlock(&pca->lock);
pm_runtime_get_sync(pca->chip.dev);
return 0;
}

[CONTEXT SWITCH back to Thread 1, still in pwm/core.c]

set_bit(PWMF_REQUESTED, &pwm->flags);
pwm->label = label;


[PATCH] spi: spidev: Fix for reverting spi max speed value only on failure

2019-06-02 Thread Vivek Pernamitta
When user space application request for change in spi clock
using ioctl, current value is taken back-up and new value is
assigned to spi->max_speed_hz, then spi_setup() function is
called with new value. If spi_setup() function fails, it needs
reverting to old spi_max_speed value only in failure condition.

Signed-off-by: Vivek Pernamitta 
---
 drivers/spi/spidev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 30498cf25f3b..70382b642f37 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -458,9 +458,10 @@ spidev_ioctl(struct file *filp, unsigned int cmd, unsigned 
long arg)
retval = spi_setup(spi);
if (retval >= 0)
spidev->speed_hz = tmp;
-   else
+   else {
dev_dbg(&spi->dev, "%d Hz (max)\n", tmp);
-   spi->max_speed_hz = save;
+   spi->max_speed_hz = save;
+   }
}
break;
 
-- 
2.17.1



[PATCH] pci: ibmphp: add check of return value from pci_hp_register()

2019-06-02 Thread Emanuel Bennici
Check the return value of pci_hp_register() in Function
ebda_rsrc_controller()

Signed-off-by: Emanuel Bennici 
---
 drivers/pci/hotplug/ibmphp_ebda.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/hotplug/ibmphp_ebda.c 
b/drivers/pci/hotplug/ibmphp_ebda.c
index 11a2661dc062..7e523ce071b3 100644
--- a/drivers/pci/hotplug/ibmphp_ebda.c
+++ b/drivers/pci/hotplug/ibmphp_ebda.c
@@ -896,10 +896,17 @@ static int __init ebda_rsrc_controller(void)
 
}   /* each hpc  */
 
+   int result = 0;
list_for_each_entry(tmp_slot, &ibmphp_slot_head, ibm_slot_list) {
snprintf(name, SLOT_NAME_SIZE, "%s", 
create_file_name(tmp_slot));
-   pci_hp_register(&tmp_slot->hotplug_slot,
-   pci_find_bus(0, tmp_slot->bus), tmp_slot->device, name);
+   result = pci_hp_register(&tmp_slot->hotplug_slot,
+pci_find_bus(0, tmp_slot->bus),
+tmp_slot->device, name);
+
+   if (result) {
+   err("pci_hp_register failed with error %d\n", result);
+   goto error;
+   }
}
 
print_ebda_hpc();
-- 
2.19.1



Re: [PATCH v2 1/2] mt76: mt7615: enable support for mesh

2019-06-02 Thread Ryder Lee
On Fri, 2019-05-31 at 22:09 +0800, Ryder Lee wrote:
> Enable NL80211_IFTYPE_MESH_POINT and update its path.
> 
> Signed-off-by: Ryder Lee 
> ---
> Changes since v2 - remove unused definitions
> ---
>  drivers/net/wireless/mediatek/mt76/mt7615/init.c | 6 ++
>  drivers/net/wireless/mediatek/mt76/mt7615/main.c | 1 +
>  drivers/net/wireless/mediatek/mt76/mt7615/mcu.c  | 5 -
>  drivers/net/wireless/mediatek/mt76/mt7615/mcu.h  | 6 --
>  4 files changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/init.c 
> b/drivers/net/wireless/mediatek/mt76/mt7615/init.c
> index 59f604f3161f..f860af6a42da 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7615/init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7615/init.c
> @@ -133,6 +133,9 @@ static const struct ieee80211_iface_limit if_limits[] = {
>   {
>   .max = MT7615_MAX_INTERFACES,
>   .types = BIT(NL80211_IFTYPE_AP) |
> +#ifdef CONFIG_MAC80211_MESH
> +  BIT(NL80211_IFTYPE_MESH_POINT) |
> +#endif
>BIT(NL80211_IFTYPE_STATION)
>   }
>  };
> @@ -195,6 +198,9 @@ int mt7615_register_device(struct mt7615_dev *dev)
>   dev->mt76.antenna_mask = 0xf;
>  
>   wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
> +#ifdef CONFIG_MAC80211_MESH
> +  BIT(NL80211_IFTYPE_MESH_POINT) |
> +#endif
>BIT(NL80211_IFTYPE_AP);
>  
>   ret = mt76_register_device(&dev->mt76, true, mt7615_rates,
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c 
> b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
> index b0bb7cc12385..585e67fa2728 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c
> @@ -37,6 +37,7 @@ static int get_omac_idx(enum nl80211_iftype type, u32 mask)
>  
>   switch (type) {
>   case NL80211_IFTYPE_AP:
> + case NL80211_IFTYPE_MESH_POINT:
>   /* ap use hw bssid 0 and ext bssid */
>   if (~mask & BIT(HW_BSSID_0))
>   return HW_BSSID_0;
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c 
> b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> index 43f70195244c..8b8db526cb16 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> @@ -754,6 +754,7 @@ int mt7615_mcu_set_bss_info(struct mt7615_dev *dev,
>  
>   switch (vif->type) {
>   case NL80211_IFTYPE_AP:
> + case NL80211_IFTYPE_MESH_POINT:
>   tx_wlan_idx = mvif->sta.wcid.idx;
>   conn_type = CONNECTION_INFRA_AP;
>   break;
> @@ -968,7 +969,8 @@ int mt7615_mcu_add_wtbl(struct mt7615_dev *dev, struct 
> ieee80211_vif *vif,
>   .rx_wtbl = {
>   .tag = cpu_to_le16(WTBL_RX),
>   .len = cpu_to_le16(sizeof(struct wtbl_rx)),
> - .rca1 = vif->type != NL80211_IFTYPE_AP,
> + .rca1 = vif->type != (NL80211_IFTYPE_AP ||
> +   NL80211_IFTYPE_MESH_POINT),

Oops, this expression is wrong. I will fix it in v3.
Sorry for the inconvenience.

Ryder



[PATCH] ASoC: ti: Fix SDMA users not providing channel names

2019-06-02 Thread Janusz Krzysztofik
McBSP used to work correctly as long as compat DMA probing, removed by
commit 642aafea8889 ("ASoC: ti: remove compat dma probing"), was
available.  New method of DMA probing apparently requires users to
provide channel names when registering with SDMA, while McBSP passes
NULLs.  Fix it.

The same probably applies to McASP (not tested), hence the patch fixes
both.

Fixes: 642aafea8889 ("ASoC: ti: remove compat dma probing")
Signed-off-by: Janusz Krzysztofik 
---
 sound/soc/ti/davinci-mcasp.c | 2 +-
 sound/soc/ti/omap-mcbsp.c| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index 9fbc759fdefe..f31805920e3e 100644
--- a/sound/soc/ti/davinci-mcasp.c
+++ b/sound/soc/ti/davinci-mcasp.c
@@ -2237,7 +2237,7 @@ static int davinci_mcasp_probe(struct platform_device 
*pdev)
ret = edma_pcm_platform_register(&pdev->dev);
break;
case PCM_SDMA:
-   ret = sdma_pcm_platform_register(&pdev->dev, NULL, NULL);
+   ret = sdma_pcm_platform_register(&pdev->dev, "tx", "rx");
break;
default:
dev_err(&pdev->dev, "No DMA controller found (%d)\n", ret);
diff --git a/sound/soc/ti/omap-mcbsp.c b/sound/soc/ti/omap-mcbsp.c
index a395598f1f20..610c5e706fd2 100644
--- a/sound/soc/ti/omap-mcbsp.c
+++ b/sound/soc/ti/omap-mcbsp.c
@@ -1438,7 +1438,7 @@ static int asoc_mcbsp_probe(struct platform_device *pdev)
if (ret)
return ret;
 
-   return sdma_pcm_platform_register(&pdev->dev, NULL, NULL);
+   return sdma_pcm_platform_register(&pdev->dev, "tx", "rx");
 }
 
 static int asoc_mcbsp_remove(struct platform_device *pdev)
-- 
2.21.0



Re: [GIT PULL] SPDX update for 5.2-rc3 - round 2

2019-06-02 Thread Joe Perches
On Sun, 2019-06-02 at 08:39 +0200, Greg KH wrote:
> The second patch fixes up a number of places in the tree where people
> mistyped the string "SPDX-License-Identifier".  Given that people can
> not even type their own name all the time without mistakes, this was
> bound to happen, and odds are, we will have to add some type of check
> for this to checkpatch.pl to catch this happening in the future.
[]
>  arch/arm/kernel/bugs.c| 2 +-
>  drivers/crypto/ux500/cryp/Makefile| 2 +-
>  drivers/phy/st/phy-stm32-usbphyc.c| 2 +-
>  drivers/pinctrl/sh-pfc/pfc-r8a77980.c | 2 +-
>  lib/test_stackinit.c  | 2 +-
>  sound/soc/codecs/max9759.c| 2 +-
>  6 files changed, 6 insertions(+), 6 deletions(-)

checkpatch already gives a warning for each of these files
except the Makefile as it has no filename extension.
Filenames without extensions are not checked.

$ ./scripts/checkpatch.pl -f --types=SPDX_LICENSE_TAG --nosummary --terse \
arch/arm/kernel/bugs.c \
drivers/crypto/ux500/cryp/Makefile \
drivers/phy/st/phy-stm32-usbphyc.c \
drivers/pinctrl/sh-pfc/pfc-r8a77980.c \
lib/test_stackinit.c \
sound/soc/codecs/max9759.c
arch/arm/kernel/bugs.c:1: WARNING: Missing or malformed SPDX-License-Identifier 
tag in line 1
drivers/phy/st/phy-stm32-usbphyc.c:1: WARNING: Missing or malformed 
SPDX-License-Identifier tag in line 1
drivers/pinctrl/sh-pfc/pfc-r8a77980.c:1: WARNING: Missing or malformed 
SPDX-License-Identifier tag in line 1
lib/test_stackinit.c:1: WARNING: Missing or malformed SPDX-License-Identifier 
tag in line 1
sound/soc/codecs/max9759.c:1: WARNING: Missing or malformed 
SPDX-License-Identifier tag in line 1




[PATCH 2/2] pci: shpchp: Remove function hpc_get_mode1_ECC_cap

2019-06-02 Thread Emanuel Bennici
Remove function hpc_get_mode1_ECC_cap since it was used by the
get_mode1_ECC_cap Callback - that was removed.
So this function is unused and can be safely removed.

Signed-off-by: Emanuel Bennici 
---
 drivers/pci/hotplug/shpchp_hpc.c | 17 -
 1 file changed, 17 deletions(-)

diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c
index 59f75e567c63..a6d713360dca 100644
--- a/drivers/pci/hotplug/shpchp_hpc.c
+++ b/drivers/pci/hotplug/shpchp_hpc.c
@@ -494,23 +494,6 @@ static int hpc_get_adapter_speed(struct slot *slot, enum 
pci_bus_speed *value)
return retval;
 }

-static int hpc_get_mode1_ECC_cap(struct slot *slot, u8 *mode)
-{
-   int retval = 0;
-   struct controller *ctrl = slot->ctrl;
-   u16 sec_bus_status = shpc_readw(ctrl, SEC_BUS_CONFIG);
-   u8 pi = shpc_readb(ctrl, PROG_INTERFACE);
-
-   if (pi == 2) {
-   *mode = (sec_bus_status & 0x0100) >> 8;
-   } else {
-   retval = -1;
-   }
-
-   ctrl_dbg(ctrl, "Mode 1 ECC cap = %d\n", *mode);
-   return retval;
-}
-
 static int hpc_query_power_fault(struct slot *slot)
 {
struct controller *ctrl = slot->ctrl;
--
2.19.1



[PATCH 1/2] pci: shpchp: Remove unused callback get_mode1_ECC_cap

2019-06-02 Thread Emanuel Bennici
This callback is never invoked/ used in this driver.
Removing this callback does not affect the driver.

Signed-off-by: Emanuel Bennici 
---
 drivers/pci/hotplug/shpchp_hpc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c
index db047284c291..59f75e567c63 100644
--- a/drivers/pci/hotplug/shpchp_hpc.c
+++ b/drivers/pci/hotplug/shpchp_hpc.c
@@ -905,7 +905,6 @@ static const struct hpc_ops shpchp_hpc_ops = {
.get_adapter_status = hpc_get_adapter_status,

.get_adapter_speed  = hpc_get_adapter_speed,
-   .get_mode1_ECC_cap  = hpc_get_mode1_ECC_cap,
.get_prog_int   = hpc_get_prog_int,

.query_power_fault  = hpc_query_power_fault,
--
2.19.1



[PATCH 1/2] pci: shpchp: Correct usage of 'return'

2019-06-02 Thread Emanuel Bennici
Replace 'return(1)' with 'return 1' because return is not a function.

Signed-off-by: Emanuel Bennici 
---
 drivers/pci/hotplug/shpchp_ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/hotplug/shpchp_ctrl.c 
b/drivers/pci/hotplug/shpchp_ctrl.c
index 078003dcde5b..a7b807b31726 100644
--- a/drivers/pci/hotplug/shpchp_ctrl.c
+++ b/drivers/pci/hotplug/shpchp_ctrl.c
@@ -342,7 +342,7 @@ static int remove_board(struct slot *p_slot)
int rc;

if (shpchp_unconfigure_device(p_slot))
-   return(1);
+   return 1;

hp_slot = p_slot->device - ctrl->slot_device_offset;
p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);
--
2.19.1



[PATCH 2/2] pci: cpqphp: Correct usage of 'return'

2019-06-02 Thread Emanuel Bennici
'return' is not correctly used here.
This Patch replaces 'return(n)' with 'return n'.

Signed-off-by: Emanuel Bennici 
---
 drivers/pci/hotplug/cpqphp_nvram.c | 48 +++---
 drivers/pci/hotplug/cpqphp_pci.c   | 24 +++
 drivers/pci/hotplug/shpchp_ctrl.c  |  2 +-
 3 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/drivers/pci/hotplug/cpqphp_nvram.c 
b/drivers/pci/hotplug/cpqphp_nvram.c
index 00cd2b43364f..2a2ffc9650d7 100644
--- a/drivers/pci/hotplug/cpqphp_nvram.c
+++ b/drivers/pci/hotplug/cpqphp_nvram.c
@@ -98,25 +98,25 @@ static u32 add_byte(u32 **p_buffer, u8 value, u32 *used, 
u32 *avail)
u8 **tByte;

if ((*used + 1) > *avail)
-   return(1);
+   return 1;

*((u8 *)*p_buffer) = value;
tByte = (u8 **)p_buffer;
(*tByte)++;
*used += 1;
-   return(0);
+   return 0;
 }


 static u32 add_dword(u32 **p_buffer, u32 value, u32 *used, u32 *avail)
 {
if ((*used + 4) > *avail)
-   return(1);
+   return 1;

**p_buffer = value;
(*p_buffer)++;
*used += 4;
-   return(0);
+   return 0;
 }


@@ -174,7 +174,7 @@ static u32 access_EV(u16 operation, u8 *ev_name, u8 
*buffer, u32 *buf_size)
: "%ebx", "%edx");
spin_unlock_irqrestore(&int15_lock, flags);

-   return((ret_val & 0xFF00) >> 8);
+   return ((ret_val & 0xFF00) >> 8);
 }


@@ -236,12 +236,12 @@ static u32 store_HRT(void __iomem *rom_start)
available = 1024;

if (!check_for_compaq_ROM(rom_start))
-   return(1);
+   return 1;

buffer = (u32 *) evbuffer;

if (!buffer)
-   return(1);
+   return 1;

pFill = buffer;
usedbytes = 0;
@@ -253,12 +253,12 @@ static u32 store_HRT(void __iomem *rom_start)
/* The revision of this structure */
rc = add_byte(&pFill, 1 + ctrl->push_flag, &usedbytes, &available);
if (rc)
-   return(rc);
+   return rc;

/* The number of controllers */
rc = add_byte(&pFill, 1, &usedbytes, &available);
if (rc)
-   return(rc);
+   return rc;

while (ctrl) {
p_ev_ctrl = (struct ev_hrt_ctrl *) pFill;
@@ -268,22 +268,22 @@ static u32 store_HRT(void __iomem *rom_start)
/* The bus number */
rc = add_byte(&pFill, ctrl->bus, &usedbytes, &available);
if (rc)
-   return(rc);
+   return rc;

/* The device Number */
rc = add_byte(&pFill, PCI_SLOT(ctrl->pci_dev->devfn), 
&usedbytes, &available);
if (rc)
-   return(rc);
+   return rc;

/* The function Number */
rc = add_byte(&pFill, PCI_FUNC(ctrl->pci_dev->devfn), 
&usedbytes, &available);
if (rc)
-   return(rc);
+   return rc;

/* Skip the number of available entries */
rc = add_dword(&pFill, 0, &usedbytes, &available);
if (rc)
-   return(rc);
+   return rc;

/* Figure out memory Available */

@@ -297,12 +297,12 @@ static u32 store_HRT(void __iomem *rom_start)
/* base */
rc = add_dword(&pFill, resNode->base, &usedbytes, 
&available);
if (rc)
-   return(rc);
+   return rc;

/* length */
rc = add_dword(&pFill, resNode->length, &usedbytes, 
&available);
if (rc)
-   return(rc);
+   return rc;

resNode = resNode->next;
}
@@ -322,12 +322,12 @@ static u32 store_HRT(void __iomem *rom_start)
/* base */
rc = add_dword(&pFill, resNode->base, &usedbytes, 
&available);
if (rc)
-   return(rc);
+   return rc;

/* length */
rc = add_dword(&pFill, resNode->length, &usedbytes, 
&available);
if (rc)
-   return(rc);
+   return rc;

resNode = resNode->next;
}
@@ -347,12 +347,12 @@ static u32 store_HRT(void __iomem *rom_start)
/* base */
rc = add_dword(&pFill, resNode->base, &usedbytes, 
&available);
if (rc)
-   return(rc);
+   return rc;

/* length */
rc = add_dword(&pFill, resNode->length, &u

[PATCH] pci: ibmphp: Replace functionname with __func__ in Messages

2019-06-02 Thread Emanuel Bennici
Replace the hardcoded Function-Names in error and debug Messages with
the __func__ Macro.
If the Function-Name changes we haven't to check all the error/ debug
messages.

Signed-off-by: Emanuel Bennici 
---
 drivers/pci/hotplug/ibmphp_core.c | 34 +++
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/drivers/pci/hotplug/ibmphp_core.c 
b/drivers/pci/hotplug/ibmphp_core.c
index 17124254d897..59840a094973 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -194,7 +194,7 @@ static inline int power_on(struct slot *slot_cur)
return retval;
}
if (CTLR_RESULT(slot_cur->ctrl->status)) {
-   err("command not completed successfully in power_on\n");
+   err("command not completed successfully in %s\n", __func__);
return -EIO;
}
msleep(3000);   /* For ServeRAID cards, and some 66 PCI */
@@ -212,7 +212,7 @@ static inline int power_off(struct slot *slot_cur)
return retval;
}
if (CTLR_RESULT(slot_cur->ctrl->status)) {
-   err("command not completed successfully in power_off\n");
+   err("command not completed successfully in %s\n", __func__);
retval = -EIO;
}
return retval;
@@ -224,8 +224,8 @@ static int set_attention_status(struct hotplug_slot 
*hotplug_slot, u8 value)
struct slot *pslot;
u8 cmd = 0x00; /* avoid compiler warning */

-   debug("set_attention_status - Entry hotplug_slot[%lx] value[%x]\n",
-   (ulong) hotplug_slot, value);
+   debug("%s - Entry hotplug_slot[%lx] value[%x]\n",
+   __func__, (ulong) hotplug_slot, value);
ibmphp_lock_operations();


@@ -242,7 +242,7 @@ static int set_attention_status(struct hotplug_slot 
*hotplug_slot, u8 value)
break;
default:
rc = -ENODEV;
-   err("set_attention_status - Error : invalid input 
[%x]\n",
+   err("%s - Error : invalid input [%x]\n", __func__,
value);
break;
}
@@ -255,7 +255,7 @@ static int set_attention_status(struct hotplug_slot 
*hotplug_slot, u8 value)

ibmphp_unlock_operations();

-   debug("set_attention_status - Exit rc[%d]\n", rc);
+   debug("%s - Exit rc[%d]\n", __func__, rc);
return rc;
 }

@@ -265,7 +265,7 @@ static int get_attention_status(struct hotplug_slot 
*hotplug_slot, u8 *value)
struct slot *pslot;
struct slot myslot;

-   debug("get_attention_status - Entry hotplug_slot[%lx] pvalue[%lx]\n",
+   debug("%s - Entry hotplug_slot[%lx] pvalue[%lx]\n", __func__,
(ulong) hotplug_slot, (ulong) value);

ibmphp_lock_operations();
@@ -282,7 +282,7 @@ static int get_attention_status(struct hotplug_slot 
*hotplug_slot, u8 *value)
}

ibmphp_unlock_operations();
-   debug("get_attention_status - Exit rc[%d] value[%x]\n", rc, *value);
+   debug("%s - Exit rc[%d] value[%x]\n", __func__, rc, *value);
return rc;
 }

@@ -292,7 +292,7 @@ static int get_latch_status(struct hotplug_slot 
*hotplug_slot, u8 *value)
struct slot *pslot;
struct slot myslot;

-   debug("get_latch_status - Entry hotplug_slot[%lx] pvalue[%lx]\n",
+   debug("%s - Entry hotplug_slot[%lx] pvalue[%lx]\n", __func__,
(ulong) hotplug_slot, (ulong) value);
ibmphp_lock_operations();
if (hotplug_slot) {
@@ -305,8 +305,7 @@ static int get_latch_status(struct hotplug_slot 
*hotplug_slot, u8 *value)
}

ibmphp_unlock_operations();
-   debug("get_latch_status - Exit rc[%d] rc[%x] value[%x]\n",
-   rc, rc, *value);
+   debug("%s - Exit rc[%d] rc[%x] value[%x]\n", __func__, rc, rc, *value);
return rc;
 }

@@ -317,7 +316,7 @@ static int get_power_status(struct hotplug_slot 
*hotplug_slot, u8 *value)
struct slot *pslot;
struct slot myslot;

-   debug("get_power_status - Entry hotplug_slot[%lx] pvalue[%lx]\n",
+   debug("%s - Entry hotplug_slot[%lx] pvalue[%lx]\n", __func__,
(ulong) hotplug_slot, (ulong) value);
ibmphp_lock_operations();
if (hotplug_slot) {
@@ -330,8 +329,7 @@ static int get_power_status(struct hotplug_slot 
*hotplug_slot, u8 *value)
}

ibmphp_unlock_operations();
-   debug("get_power_status - Exit rc[%d] rc[%x] value[%x]\n",
-   rc, rc, *value);
+   debug("%s - Exit rc[%d] rc[%x] value[%x]\n", __func__, rc, rc, *value);
return rc;
 }

@@ -360,7 +358,7 @@ static int get_adapter_present(struct hotplug_slot 
*hotplug_slot, u8 *value)
}

ibmphp_unlock_operations();
-   debug("get_adapte

[PATCH 1/5] staging: kpc2000: kpc_spi: Remove unnecessary consecutive newlines

2019-06-02 Thread Geordan Neukum
The kpc2000_spi.c file contains instances of unnecessary consecutive
newlines which negatively impact the readability of the file. Remove
all unnecessary consecutive newlines.

Signed-off-by: Geordan Neukum 
---
 drivers/staging/kpc2000/kpc2000_spi.c | 13 -
 1 file changed, 13 deletions(-)

diff --git a/drivers/staging/kpc2000/kpc2000_spi.c 
b/drivers/staging/kpc2000/kpc2000_spi.c
index 9a23808ffaa1..ef7e062bf52c 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -97,8 +97,6 @@ static struct spi_board_info p2kr0_board_info[] = {
 #define KP_SPI_REG_STATUS_RXFFE 0x40
 #define KP_SPI_REG_STATUS_RXFFF 0x80
 
-
-
 /**
  * SPI Structures *
  **/
@@ -111,7 +109,6 @@ struct kp_spi {
unsigned intpin_dir:1;
 };
 
-
 struct kp_spi_controller_state {
void __iomem   *base;
unsigned long   phys;
@@ -120,7 +117,6 @@ struct kp_spi_controller_state {
s64 conf_cache;
 };
 
-
 union kp_spi_config {
/* use this to access individual elements */
struct __attribute__((packed)) spi_config_bitfield {
@@ -141,8 +137,6 @@ union kp_spi_config {
u32 reg;
 };
 
-
-
 union kp_spi_status {
struct __attribute__((packed)) spi_status_bitfield {
unsigned int rx:  1; /* Rx Status   */
@@ -158,8 +152,6 @@ union kp_spi_status {
u32 reg;
 };
 
-
-
 union kp_spi_ffctrl {
struct __attribute__((packed)) spi_ffctrl_bitfield {
unsigned int ffstart :  1; /* FIFO Start */
@@ -168,8 +160,6 @@ union kp_spi_ffctrl {
u32 reg;
 };
 
-
-
 /***
  * SPI Helpers *
  ***/
@@ -445,8 +435,6 @@ kp_spi_cleanup(struct spi_device *spidev)
}
 }
 
-
-
 /**
  * Probe / Remove *
  **/
@@ -538,7 +526,6 @@ kp_spi_remove(struct platform_device *pldev)
return 0;
 }
 
-
 static struct platform_driver kp_spi_driver = {
.driver = {
.name = KP_DRIVER_NAME_SPI,
-- 
2.21.0



[PATCH 5/5] staging: kpc2000: kpc_spi: use devm_* API to manage mapped I/O space

2019-06-02 Thread Geordan Neukum
The kpc_spi driver does not unmap its I/O space upon error cases in the
probe() function or upon remove(). Make the driver clean up after itself
more maintainably by migrating to using the managed resource API.

Signed-off-by: Geordan Neukum 
---
 drivers/staging/kpc2000/kpc2000_spi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/kpc2000/kpc2000_spi.c 
b/drivers/staging/kpc2000/kpc2000_spi.c
index b513432a26ed..32d3ec532e26 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -471,7 +471,8 @@ kp_spi_probe(struct platform_device *pldev)
goto free_master;
}
 
-   kpspi->phys = (unsigned long)ioremap_nocache(r->start, 
resource_size(r));
+   kpspi->phys = (unsigned long)devm_ioremap_nocache(&pldev->dev, r->start,
+ resource_size(r));
kpspi->base = (u64 __iomem *)kpspi->phys;
 
status = spi_register_master(master);
-- 
2.21.0



[PATCH 4/5] staging: kpc2000: kpc_spi: remove function kp_spi_bytes_per_word()

2019-06-02 Thread Geordan Neukum
The static function kp_spi_bytes_per_word() is defined in kpc2000_spi.c,
but it is completely unused. As this function is unused, it can and
should be removed.

Signed-off-by: Geordan Neukum 
---
 drivers/staging/kpc2000/kpc2000_spi.c | 14 --
 1 file changed, 14 deletions(-)

diff --git a/drivers/staging/kpc2000/kpc2000_spi.c 
b/drivers/staging/kpc2000/kpc2000_spi.c
index 049b1e324031..b513432a26ed 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -162,20 +162,6 @@ union kp_spi_ffctrl {
 /***
  * SPI Helpers *
  ***/
-   static inline int
-kp_spi_bytes_per_word(int word_len)
-{
-   if (word_len <= 8){
-   return 1;
-   }
-   else if (word_len <= 16) {
-   return 2;
-   }
-   else { /* word_len <= 32 */
-   return 4;
-   }
-}
-
static inline u64
 kp_spi_read_reg(struct kp_spi_controller_state *cs, int idx)
 {
-- 
2.21.0



[PATCH 0/5] staging: kpc2000: kpc_spi: Assorted small fixes

2019-06-02 Thread Geordan Neukum
This patch set contains a few small fixups to the kpc_spi driver. There
is certainly nothing groundbreaking in this patch set. It is limited to
style fixups, removing unused things, and using the managed resource API
for mapping I/O space.

Geordan Neukum (5):
  staging: kpc2000: kpc_spi: Remove unnecessary consecutive newlines
  staging: kpc2000: kpc_spi: column-align switch and subordinate cases
  staging: kpc2000: kpc_spi: remove fifo_depth from kp_spi struct
  staging: kpc2000: kpc_spi: remove function kp_spi_bytes_per_word()
  staging: kpc2000: kpc_spi: use devm_* API to manage mapped I/O space

 drivers/staging/kpc2000/kpc2000_spi.c | 45 ++-
 1 file changed, 9 insertions(+), 36 deletions(-)

-- 
2.21.0



[PATCH 3/5] staging: kpc2000: kpc_spi: remove fifo_depth from kp_spi struct

2019-06-02 Thread Geordan Neukum
The kp_spi structure contains a member 'fifo_depth'. This member is
never used. Therefore, it should be removed.

Signed-off-by: Geordan Neukum 
---
 drivers/staging/kpc2000/kpc2000_spi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/kpc2000/kpc2000_spi.c 
b/drivers/staging/kpc2000/kpc2000_spi.c
index 13c4651e1fac..049b1e324031 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -105,7 +105,6 @@ struct kp_spi {
u64 __iomem*base;
unsigned long   phys;
struct device  *dev;
-   int fifo_depth;
unsigned intpin_dir:1;
 };
 
-- 
2.21.0



[PATCH 2/5] staging: kpc2000: kpc_spi: column-align switch and subordinate cases

2019-06-02 Thread Geordan Neukum
The linux style guide prescribes that switch statements and their
subordinate case labels should be column-aligned rather than
double-indenting the case label. Make kpc2000_spi.c follow the desired
style with respect to switch/case alignment.

Signed-off-by: Geordan Neukum 
---
 drivers/staging/kpc2000/kpc2000_spi.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/kpc2000/kpc2000_spi.c 
b/drivers/staging/kpc2000/kpc2000_spi.c
index ef7e062bf52c..13c4651e1fac 100644
--- a/drivers/staging/kpc2000/kpc2000_spi.c
+++ b/drivers/staging/kpc2000/kpc2000_spi.c
@@ -502,13 +502,13 @@ kp_spi_probe(struct platform_device *pldev)
}
 
switch ((drvdata->card_id & 0x) >> 16){
-   case PCI_DEVICE_ID_DAKTRONICS_KADOKA_P2KR0:
-   NEW_SPI_DEVICE_FROM_BOARD_INFO_TABLE(p2kr0_board_info);
-   break;
-   default:
-   dev_err(&pldev->dev, "Unknown hardware, cant know what 
partition table to use!\n");
-   goto free_master;
-   break;
+   case PCI_DEVICE_ID_DAKTRONICS_KADOKA_P2KR0:
+   NEW_SPI_DEVICE_FROM_BOARD_INFO_TABLE(p2kr0_board_info);
+   break;
+   default:
+   dev_err(&pldev->dev, "Unknown hardware, cant know what 
partition table to use!\n");
+   goto free_master;
+   break;
}
 
return status;
-- 
2.21.0



[PATCH] pci: hotplug: ibmphp: Add white space to Debug Message

2019-06-02 Thread Emanuel Bennici
Add a Whitespace between '-' and 'Exit' to keep the log messages consistent

Signed-off-by: Emanuel Bennici 
---
 drivers/pci/hotplug/ibmphp_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/hotplug/ibmphp_core.c 
b/drivers/pci/hotplug/ibmphp_core.c
index 59840a094973..cd73bea12bc7 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -890,7 +890,7 @@ static int set_bus(struct slot *slot_cur)
/* This is for x440, once Brandon fixes the firmware,
will not need this delay */
msleep(1000);
-   debug("%s -Exit\n", __func__);
+   debug("%s - Exit\n", __func__);
return 0;
 }

--
2.19.1



[PATCH] pci: hotplug: Replace function names with __func__ Macro

2019-06-02 Thread Emanuel Bennici
Replace hardcoded function names with __func__ Macro so if the function
name changes we have not to check all Messages and to retain the code
structure.

Signed-off-by: Emanuel Bennici 
---
 drivers/pci/hotplug/cpqphp_ctrl.c |  4 ++--
 drivers/pci/hotplug/ibmphp_ebda.c |  4 ++--
 drivers/pci/hotplug/ibmphp_hpc.c  | 15 ---
 drivers/pci/hotplug/ibmphp_res.c  |  2 +-
 drivers/pci/hotplug/rpaphp_slot.c |  3 ++-
 5 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c 
b/drivers/pci/hotplug/cpqphp_ctrl.c
index b7f4e1f099d9..4f4e3725566e 100644
--- a/drivers/pci/hotplug/cpqphp_ctrl.c
+++ b/drivers/pci/hotplug/cpqphp_ctrl.c
@@ -401,7 +401,7 @@ static struct pci_resource 
*do_pre_bridge_resource_split(struct pci_resource **h
struct pci_resource *split_node;
u32 rc;
u32 temp_dword;
-   dbg("do_pre_bridge_resource_split\n");
+   dbg("%s\n", __func__);

if (!(*head) || !(*orig_head))
return NULL;
@@ -2297,7 +2297,7 @@ static u32 configure_new_device(struct controller  *ctrl, 
struct pci_func  *func
}

} while (function < max_functions);
-   dbg("returning from configure_new_device\n");
+   dbg("returning from %s\n", __func__);

return 0;
 }
diff --git a/drivers/pci/hotplug/ibmphp_ebda.c 
b/drivers/pci/hotplug/ibmphp_ebda.c
index 7e523ce071b3..7bea904a5203 100644
--- a/drivers/pci/hotplug/ibmphp_ebda.c
+++ b/drivers/pci/hotplug/ibmphp_ebda.c
@@ -130,7 +130,7 @@ static void __init print_bus_info(void)
 static void print_lo_info(void)
 {
struct rio_detail *ptr;
-   debug("print_lo_info \n");
+   debug("%s \n", __func__);
list_for_each_entry(ptr, &rio_lo_head, rio_detail_list) {
debug("%s - rio_node_id = %x\n", __func__, ptr->rio_node_id);
debug("%s - rio_type = %x\n", __func__, ptr->rio_type);
@@ -1112,7 +1112,7 @@ static int ibmphp_probe(struct pci_dev *dev, const struct 
pci_device_id *ids)
 {
struct controller *ctrl;

-   debug("inside ibmphp_probe\n");
+   debug("inside %s\n", __func__);

list_for_each_entry(ctrl, &ebda_hpc_head, ebda_hpc_list) {
if (ctrl->ctlr_type == 1) {
diff --git a/drivers/pci/hotplug/ibmphp_hpc.c b/drivers/pci/hotplug/ibmphp_hpc.c
index 508a62a6b5f9..6846923b42d3 100644
--- a/drivers/pci/hotplug/ibmphp_hpc.c
+++ b/drivers/pci/hotplug/ibmphp_hpc.c
@@ -350,7 +350,7 @@ static void isa_ctrl_write(struct controller *ctlr_ptr, u8 
offset, u8 data)
 static u8 pci_ctrl_read(struct controller *ctrl, u8 offset)
 {
u8 data = 0x00;
-   debug("inside pci_ctrl_read\n");
+   debug("inside %s\n", __func__);
if (ctrl->ctrl_dev)
pci_read_config_byte(ctrl->ctrl_dev, HPC_PCI_OFFSET + offset, 
&data);
return data;
@@ -359,7 +359,7 @@ static u8 pci_ctrl_read(struct controller *ctrl, u8 offset)
 static u8 pci_ctrl_write(struct controller *ctrl, u8 offset, u8 data)
 {
u8 rc = -ENODEV;
-   debug("inside pci_ctrl_write\n");
+   debug("inside %s\n", __func__);
if (ctrl->ctrl_dev) {
pci_write_config_byte(ctrl->ctrl_dev, HPC_PCI_OFFSET + offset, 
data);
rc = 0;
@@ -445,7 +445,7 @@ static u8 hpc_writecmdtoindex(u8 cmd, u8 index)
break;

default:
-   err("hpc_writecmdtoindex - Error invalid cmd[%x]\n", cmd);
+   err("%s - Error invalid cmd[%x]\n", __func__, cmd);
rc = HPC_ERROR;
}

@@ -903,7 +903,8 @@ static int process_changeinstatus(struct slot *pslot, 
struct slot *poldslot)
u8 disable = 0;
u8 update = 0;

-   debug("process_changeinstatus - Entry pslot[%p], poldslot[%p]\n", 
pslot, poldslot);
+   debug("%s - Entry pslot[%p], poldslot[%p]\n", __func__, pslot,
+   poldslot);

// bit 0 - HPC_SLOT_POWER
if ((pslot->status & 0x01) != (poldslot->status & 0x01))
@@ -959,7 +960,7 @@ static int process_changeinstatus(struct slot *pslot, 
struct slot *poldslot)
update = 1;

if (disable) {
-   debug("process_changeinstatus - disable slot\n");
+   debug("%s - disable slot\n", __func__);
pslot->flag = 0;
rc = ibmphp_do_disable_slot(pslot);
}
@@ -1071,7 +1072,7 @@ static int hpc_wait_ctlr_notworking(int timeout, struct 
controller *ctlr_ptr, vo
int rc = 0;
u8 done = 0;

-   debug_polling("hpc_wait_ctlr_notworking - Entry timeout[%d]\n", 
timeout);
+   debug_polling("%s - Entry timeout[%d]\n", __func__, timeout);

while (!done) {
*pstatus = ctrl_read(ctlr_ptr, wpg_bbar, WPG_CTLR_INDEX);
@@ -1091,6 +1092,6 @@ static int hpc_wait_ctlr_notworking(int timeout, struct 
controller *ctlr_ptr, vo
timeout--;
}
}
-   debug_polling("hpc_wait_ctlr_notworking - Exit rc[%x] status[%

Re: [PATCH] pci: hotplug: ibmphp: Add white space to Debug Message

2019-06-02 Thread Joe Perches
On Sun, 2019-06-02 at 18:00 +0200, Emanuel Bennici wrote:
> Add a Whitespace between '-' and 'Exit' to keep the log messages consistent
[]
> diff --git a/drivers/pci/hotplug/ibmphp_core.c 
> b/drivers/pci/hotplug/ibmphp_core.c
[]
> @@ -890,7 +890,7 @@ static int set_bus(struct slot *slot_cur)
>   /* This is for x440, once Brandon fixes the firmware,
>   will not need this delay */
>   msleep(1000);
> - debug("%s -Exit\n", __func__);
> + debug("%s - Exit\n", __func__);

These sorts of messages should just be deleted
and the function tracer (ftrace) used instead.




Re: [PATCH] pci: hotplug: Replace function names with __func__ Macro

2019-06-02 Thread Joe Perches
On Sun, 2019-06-02 at 18:12 +0200, Emanuel Bennici wrote:
> Replace hardcoded function names with __func__ Macro so if the function
> name changes we have not to check all Messages and to retain the code
> structure.

trivia:

__func__ isn't a macro, it's a predefined identifier.
see the c90 standard section 6.4.2.2





[PATCH] pci: hotplug: ibmphp: Fix 'line over 80 characters' Warning

2019-06-02 Thread Emanuel Bennici
Fix checkpatch.pl 'line over 80 characters' Warning in ibmphp_ebda.c and
ibmphp_hpc.c

Signed-off-by: Emanuel Bennici 
---
 drivers/pci/hotplug/ibmphp_ebda.c |   7 +-
 drivers/pci/hotplug/ibmphp_hpc.c  | 107 +++---
 2 files changed, 75 insertions(+), 39 deletions(-)

diff --git a/drivers/pci/hotplug/ibmphp_ebda.c 
b/drivers/pci/hotplug/ibmphp_ebda.c
index 7bea904a5203..fda0d1210a3b 100644
--- a/drivers/pci/hotplug/ibmphp_ebda.c
+++ b/drivers/pci/hotplug/ibmphp_ebda.c
@@ -1116,10 +1116,13 @@ static int ibmphp_probe(struct pci_dev *dev, const 
struct pci_device_id *ids)

list_for_each_entry(ctrl, &ebda_hpc_head, ebda_hpc_list) {
if (ctrl->ctlr_type == 1) {
-   if ((dev->devfn == ctrl->u.pci_ctlr.dev_fun) && 
(dev->bus->number == ctrl->u.pci_ctlr.bus)) {
+   if ((dev->devfn == ctrl->u.pci_ctlr.dev_fun) &&
+   (dev->bus->number == ctrl->u.pci_ctlr.bus)) {
ctrl->ctrl_dev = dev;
debug("found device!!!\n");
-   debug("dev->device = %x, dev->subsystem_device 
= %x\n", dev->device, dev->subsystem_device);
+   debug("dev->device = %x, "
+ "dev->subsystem_device = %x\n",
+ dev->device, dev->subsystem_device);
return 0;
}
}
diff --git a/drivers/pci/hotplug/ibmphp_hpc.c b/drivers/pci/hotplug/ibmphp_hpc.c
index 6846923b42d3..e75173db5734 100644
--- a/drivers/pci/hotplug/ibmphp_hpc.c
+++ b/drivers/pci/hotplug/ibmphp_hpc.c
@@ -115,7 +115,8 @@ static int hpc_wait_ctlr_notworking(int, struct controller 
*, void __iomem *, u8
 * Action:  read from HPC over I2C
 *
 *-*/
-static u8 i2c_ctrl_read(struct controller *ctlr_ptr, void __iomem *WPGBbar, u8 
index)
+static u8 i2c_ctrl_read(struct controller *ctlr_ptr, void __iomem *WPGBbar,
+   u8 index)
 {
u8 status;
int i;
@@ -124,7 +125,8 @@ static u8 i2c_ctrl_read(struct controller *ctlr_ptr, void 
__iomem *WPGBbar, u8 i
unsigned long ultemp;
unsigned long data; // actual data HILO format

-   debug_polling("%s - Entry WPGBbar[%p] index[%x] \n", __func__, WPGBbar, 
index);
+   debug_polling("%s - Entry WPGBbar[%p] index[%x] \n",
+   __func__, WPGBbar, index);

//
// READ - step 1
@@ -211,7 +213,8 @@ static u8 i2c_ctrl_read(struct controller *ctlr_ptr, void 
__iomem *WPGBbar, u8 i

status = (u8) data;

-   debug_polling("%s - Exit index[%x] status[%x]\n", __func__, index, 
status);
+   debug_polling("%s - Exit index[%x] status[%x]\n",
+   __func__, index, status);

return (status);
 }
@@ -223,7 +226,8 @@ static u8 i2c_ctrl_read(struct controller *ctlr_ptr, void 
__iomem *WPGBbar, u8 i
 *
 * Return   0 or error codes
 *-*/
-static u8 i2c_ctrl_write(struct controller *ctlr_ptr, void __iomem *WPGBbar, 
u8 index, u8 cmd)
+static u8 i2c_ctrl_write(struct controller *ctlr_ptr, void __iomem *WPGBbar,
+   u8 index, u8 cmd)
 {
u8 rc;
void __iomem *wpg_addr; // base addr + offset
@@ -232,7 +236,8 @@ static u8 i2c_ctrl_write(struct controller *ctlr_ptr, void 
__iomem *WPGBbar, u8
unsigned long data; // actual data HILO format
int i;

-   debug_polling("%s - Entry WPGBbar[%p] index[%x] cmd[%x]\n", __func__, 
WPGBbar, index, cmd);
+   debug_polling("%s - Entry WPGBbar[%p] index[%x] cmd[%x]\n",
+   __func__, WPGBbar, index, cmd);

rc = 0;
//
@@ -352,7 +357,8 @@ static u8 pci_ctrl_read(struct controller *ctrl, u8 offset)
u8 data = 0x00;
debug("inside %s\n", __func__);
if (ctrl->ctrl_dev)
-   pci_read_config_byte(ctrl->ctrl_dev, HPC_PCI_OFFSET + offset, 
&data);
+   pci_read_config_byte(ctrl->ctrl_dev, HPC_PCI_OFFSET + offset,
+   &data);
return data;
 }

@@ -361,7 +367,8 @@ static u8 pci_ctrl_write(struct controller *ctrl, u8 
offset, u8 data)
u8 rc = -ENODEV;
debug("inside %s\n", __func__);
if (ctrl->ctrl_dev) {
-   pci_write_config_byte(ctrl->ctrl_dev, HPC_PCI_OFFSET + offset, 
data);
+   pci_write_config_byte(ctrl->ctrl_dev, HPC_PCI_OFFSET + offset,
+   data);
rc = 0;
}
return rc;
@@ -387,7 +394,8 @@ static u8 ctrl_read(struct controller *ctlr, void __iomem 
*base, u8 offset)
return rc;
 }


Re: [GIT PULL] SCSI fixes for 5.2-rc1

2019-06-02 Thread pr-tracker-bot
The pull request you sent on Sat, 01 Jun 2019 14:45:12 +0300:

> git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/1975b337ce26b53814f1b5c55b260649a7115393

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


[PATCH] pci: hotplug: ibmphp: Remove superfluous debug message

2019-06-02 Thread Emanuel Bennici
The 'Exit' Debug message is superfluous ftrace can be used instead.

Signed-off-by: Emanuel Bennici 
---
 drivers/pci/hotplug/ibmphp_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pci/hotplug/ibmphp_core.c 
b/drivers/pci/hotplug/ibmphp_core.c
index cd73bea12bc7..a2ea1ff6cfbc 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -890,7 +890,6 @@ static int set_bus(struct slot *slot_cur)
/* This is for x440, once Brandon fixes the firmware,
will not need this delay */
msleep(1000);
-   debug("%s - Exit\n", __func__);
return 0;
 }

--
2.19.1



[PATCH 1/2] staging: rtl8188eu: remove redundant definition of ETH_ALEN

2019-06-02 Thread Michael Straube
ETH_ALEN is defined in linux/if_ether.h which is included by
osdep_service.h, so remove the redundant definition from ieee80211.h.

osdep_service.h:33:#include 
etherdevice.h:25:#include 

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/include/ieee80211.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/include/ieee80211.h 
b/drivers/staging/rtl8188eu/include/ieee80211.h
index c60b833ca110..d43aa4304ca5 100644
--- a/drivers/staging/rtl8188eu/include/ieee80211.h
+++ b/drivers/staging/rtl8188eu/include/ieee80211.h
@@ -14,7 +14,6 @@
 
 #define MGMT_QUEUE_NUM 5
 
-#define ETH_ALEN   6
 #define ETH_TYPE_LEN   2
 #define PAYLOAD_TYPE_LEN   1
 
-- 
2.21.0



[PATCH 2/2] staging: rtl8188eu: remove unused definitions from ieee80211.h

2019-06-02 Thread Michael Straube
MGMT_QUEUE_NUM, ETH_TYPE_LEN and PAYLOAD_TYPE_LEN are defined but
not used in the driver code, so remove them.

Signed-off-by: Michael Straube 
---
 drivers/staging/rtl8188eu/include/ieee80211.h | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/ieee80211.h 
b/drivers/staging/rtl8188eu/include/ieee80211.h
index d43aa4304ca5..42ee4ebe90eb 100644
--- a/drivers/staging/rtl8188eu/include/ieee80211.h
+++ b/drivers/staging/rtl8188eu/include/ieee80211.h
@@ -12,11 +12,6 @@
 #include "wifi.h"
 #include 
 
-#define MGMT_QUEUE_NUM 5
-
-#define ETH_TYPE_LEN   2
-#define PAYLOAD_TYPE_LEN   1
-
 #ifdef CONFIG_88EU_AP_MODE
 
 #define RTL_IOCTL_HOSTAPD (SIOCIWFIRSTPRIV + 28)
-- 
2.21.0



Re: [PATCH v4 2/2] ARM: OMAP2: drop explicit assembler architecture

2019-06-02 Thread Stefan Agner
On 30.05.2019 22:02, Nick Desaulniers wrote:
> On Mon, May 27, 2019 at 3:41 PM Stefan Agner  wrote:
>>
>> OMAP2 depends on ARCH_MULTI_V6, which makes sure that the kernel is
>> compiled with -march=armv6. The compiler frontend will pass the
>> architecture to the assembler. There is no explicit architecture
>> specification necessary.
>>
>> Signed-off-by: Stefan Agner 
>> Acked-by: Tony Lindgren 
>> ---
>> Changes since v2:
>> - New patch
>>
>> Changes since v3:
>> - Rebase on top of v5.2-rc2
> 
> Hi Stefan, looks like both patches are ack'd.  Are you waiting for an
> explicit reviewed by tag to submit to
> https://www.armlinux.org.uk/developer/patches/?

This should go through arm-soc, it missed the last merge window, see
Olofs message:
https://lore.kernel.org/lkml/20190516214819.dopw4eiumt6is46e@localhost/T/#u

Should be still early enough to make it in this merge window.

--
Stefan


[PATCH v2] pci: hotplug: ibmphp: Remove superfluous debug message

2019-06-02 Thread Emanuel Bennici
The 'Exit' Debug message is superfluous ftrace can be used instead.

Signed-off-by: Emanuel Bennici 
---
 drivers/pci/hotplug/ibmphp_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pci/hotplug/ibmphp_core.c 
b/drivers/pci/hotplug/ibmphp_core.c
index cd73bea12bc7..a2ea1ff6cfbc 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -890,7 +890,6 @@ static int set_bus(struct slot *slot_cur)
/* This is for x440, once Brandon fixes the firmware,
will not need this delay */
msleep(1000);
-   debug("%s - Exit\n", __func__);
return 0;
 }

--
2.19.1



[PATCH] sched/fair: Cleanup definition of NOHZ blocked load functions

2019-06-02 Thread Valentin Schneider
cfs_rq_has_blocked() and others_have_blocked() are only used within
update_blocked_averages(). The !CONFIG_FAIR_GROUP_SCHED version of the
latter calls them within a #define CONFIG_NO_HZ_COMMON block, whereas
the CONFIG_FAIR_GROUP_SCHED one calls them unconditionnally.

As reported by Qian, the above leads to this warning in
!CONFIG_NO_HZ_COMMON configs:

  kernel/sched/fair.c: In function 'update_blocked_averages':
  kernel/sched/fair.c:7750:7: warning: variable 'done' set but not used
  [-Wunused-but-set-variable]

It wouldn't be wrong to keep cfs_rq_has_blocked() and
others_have_blocked() as they are, but since their only current use is
to figure out when we can stop calling update_blocked_averages() on
fully decayed NOHZ idle CPUs, we can give them a new definition for
!CONFIG_NO_HZ_COMMON.

Change the definition of cfs_rq_has_blocked() and
others_have_blocked() for !CONFIG_NO_HZ_COMMON so that the
NOHZ-specific blocks of update_blocked_averages() become no-ops and
the 'done' variable gets optimised out.

No change in functionality intended.

Reported-by: Qian Cai 
Signed-off-by: Valentin Schneider 
---
 kernel/sched/fair.c | 23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f35930f5e528..03919a316a03 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7695,6 +7695,7 @@ static void attach_tasks(struct lb_env *env)
rq_unlock(env->dst_rq, &rf);
 }
 
+#ifdef CONFIG_NO_HZ_COMMON
 static inline bool cfs_rq_has_blocked(struct cfs_rq *cfs_rq)
 {
if (cfs_rq->avg.load_avg)
@@ -7721,6 +7722,10 @@ static inline bool others_have_blocked(struct rq *rq)
 
return false;
 }
+#else
+static inline bool cfs_rq_has_blocked(struct cfs_rq *cfs_rq) { return false; }
+static inline bool others_have_blocked(struct rq *rq) { return false; }
+#endif
 
 #ifdef CONFIG_FAIR_GROUP_SCHED
 
@@ -7741,6 +7746,18 @@ static inline bool cfs_rq_is_decayed(struct cfs_rq 
*cfs_rq)
return true;
 }
 
+#ifdef CONFIG_NO_HZ_COMMON
+static inline void update_blocked_load_status(struct rq *rq, bool has_blocked)
+{
+   rq->last_blocked_load_update_tick = jiffies;
+
+   if (!has_blocked)
+   rq->has_blocked_load = 0;
+}
+#else
+static inline void update_blocked_load_status(struct rq *rq, bool has_blocked) 
{}
+#endif
+
 static void update_blocked_averages(int cpu)
 {
struct rq *rq = cpu_rq(cpu);
@@ -7787,11 +7804,7 @@ static void update_blocked_averages(int cpu)
if (others_have_blocked(rq))
done = false;
 
-#ifdef CONFIG_NO_HZ_COMMON
-   rq->last_blocked_load_update_tick = jiffies;
-   if (done)
-   rq->has_blocked_load = 0;
-#endif
+   update_blocked_load_status(rq, !done);
rq_unlock_irqrestore(rq, &rf);
 }
 
-- 
2.20.1



checkpatch query regarding .c and .h files..

2019-06-02 Thread Valdis Klētnieks
scripts/checkpatch.pl contains this code near line 3070:

   if ($realfile =~ /\.(h|s|S)$/) {
$comment = '/*';
} elsif ($realfile =~ /\.(c|dts|dtsi)$/) {
$comment = '//';
} elsif (($checklicenseline == 2) || $realfile 
=~ /\.(sh|pl|py|awk|tc)$/) {
$comment = '#';
} elsif ($realfile =~ /\.rst$/) {
$comment = '..';
}

Was there a specific reason why .h files have /* */ and .c files have C89 // on
the SPDX comment line?

Would anybody like a patch that fixed checkpatch to allow either flavor on .c 
and .h files?
(I know I would, I just blew close to an hour trying to figure out why it 
whined about a
SPDX in a .h file I'm getting ready to upstream...)



pgpu582FyT7Y0.pgp
Description: PGP signature


Re: [PATCH v2 1/9] staging: rtl8712: Fixed CamelCase rename ImrContent to imr_content

2019-06-02 Thread Greg KH
On Sun, Jun 02, 2019 at 03:55:30PM +0530, Deepak Mishra wrote:
> This patch renames CamelCase ImrContent to imr_content in struct _adapter and 
> related
> files drv_types.h, rtl871x_mp_ioctl.c, rtl871x_pwrctrl.h
> 
> CHECK: Avoid CamelCase: 
> 
> Signed-off-by: Deepak Mishra 
> ---
>  drivers/staging/rtl8712/drv_types.h| 2 +-
>  drivers/staging/rtl8712/rtl871x_mp_ioctl.c | 2 +-
>  drivers/staging/rtl8712/rtl871x_pwrctrl.h  | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/rtl8712/drv_types.h 
> b/drivers/staging/rtl8712/drv_types.h
> index 9ae86631fa8b..89ebb5a49d25 100644
> --- a/drivers/staging/rtl8712/drv_types.h
> +++ b/drivers/staging/rtl8712/drv_types.h
> @@ -149,7 +149,7 @@ struct _adapter {
>   boolsurprise_removed;
>   boolsuspended;
>   u32 IsrContent;
> - u32 ImrContent;
> + u32 imr_content;
>   u8  EepromAddressSize;
>   u8  hw_init_completed;
>   struct task_struct *cmdThread;

This field is never used?  Why not just delete it?

> diff --git a/drivers/staging/rtl8712/rtl871x_mp_ioctl.c 
> b/drivers/staging/rtl8712/rtl871x_mp_ioctl.c
> index 588346da1412..4cf9d3afd2c5 100644
> --- a/drivers/staging/rtl8712/rtl871x_mp_ioctl.c
> +++ b/drivers/staging/rtl8712/rtl871x_mp_ioctl.c
> @@ -665,7 +665,7 @@ uint oid_rt_pro_write_register_hdl(struct oid_par_priv 
> *poid_par_priv)
>   if ((status == RNDIS_STATUS_SUCCESS) &&
>   (RegRWStruct->offset == HIMR) &&
>   (RegRWStruct->width == 4))
> - Adapter->ImrContent = RegRWStruct->value;
> + Adapter->imr_content = RegRWStruct->value;

It is set and never read?  Please remove.

thanks,

greg k-h


Re: [PATCH v2 4/9] staging: rtl8712: Fixed CamelCase renames evtThread to evt_thread

2019-06-02 Thread Greg KH
On Sun, Jun 02, 2019 at 03:55:33PM +0530, Deepak Mishra wrote:
> This patch fixes CamelCase renames evtThread to evt_thread in struct _adapter 
> as reported by
> checkpatch.pl
> CHECK: Avoid CamelCase: 
> 
> Signed-off-by: Deepak Mishra 
> ---
>  drivers/staging/rtl8712/drv_types.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8712/drv_types.h 
> b/drivers/staging/rtl8712/drv_types.h
> index c6faafb13bdf..5360f049088a 100644
> --- a/drivers/staging/rtl8712/drv_types.h
> +++ b/drivers/staging/rtl8712/drv_types.h
> @@ -153,7 +153,7 @@ struct _adapter {
>   u8  eeprom_address_size;
>   u8  hw_init_completed;
>   struct task_struct *cmd_thread;
> - pid_t evtThread;
> + pid_t evt_thread;

If this is never used, please delete it.

thanks,

greg k-h


Re: [PATCH v2 5/9] staging: rtl8712: Fixed CamelCase renames IsrContent to isr_content

2019-06-02 Thread Greg KH
On Sun, Jun 02, 2019 at 03:55:34PM +0530, Deepak Mishra wrote:
> This patch fixes CamelCase IsrContent to isr_content as suggested by
> checkpatch.pl
> 
> Signed-off-by: Deepak Mishra 
> ---
>  drivers/staging/rtl8712/drv_types.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8712/drv_types.h 
> b/drivers/staging/rtl8712/drv_types.h
> index 5360f049088a..a5060a020b2b 100644
> --- a/drivers/staging/rtl8712/drv_types.h
> +++ b/drivers/staging/rtl8712/drv_types.h
> @@ -148,7 +148,7 @@ struct _adapter {
>   booldriver_stopped;
>   boolsurprise_removed;
>   boolsuspended;
> - u32 IsrContent;
> + u32 isr_content;
>   u32 imr_content;
>   u8  eeprom_address_size;
>   u8  hw_init_completed;

Same comment here, just remove unused variables.  Is this structure even
ever used anywhere?

thanks,

greg k-h


Re: [PATCH v2 6/9] staging: rtl8712: Fixed CamelCase renames xmitThread and recvThread

2019-06-02 Thread Greg KH
On Sun, Jun 02, 2019 at 03:55:35PM +0530, Deepak Mishra wrote:
> This patch fixes CamelCase as reported by checkpatch.pl
> xmitThread renamed to xmit_thread
> recvThread renamed to recv_thread
> 
> Signed-off-by: Deepak Mishra 
> ---
>  drivers/staging/rtl8712/drv_types.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8712/drv_types.h 
> b/drivers/staging/rtl8712/drv_types.h
> index a5060a020b2b..1f8aa0358b77 100644
> --- a/drivers/staging/rtl8712/drv_types.h
> +++ b/drivers/staging/rtl8712/drv_types.h
> @@ -154,8 +154,8 @@ struct _adapter {
>   u8  hw_init_completed;
>   struct task_struct *cmd_thread;
>   pid_t evt_thread;
> - struct task_struct *xmitThread;
> - pid_t recvThread;
> + struct task_struct *xmit_thread;
> + pid_t recv_thread;
>   uint (*dvobj_init)(struct _adapter *adapter);
>   void (*dvobj_deinit)(struct _adapter *adapter);
>   struct net_device *pnetdev;

Again, please just remove the fields entirely.

thanks,

greg k-h


Re: [PATCH v2 8/9] staging: rtl8712: fixed enable_rx_ff0_filter as bool and CamelCase

2019-06-02 Thread Greg KH
On Sun, Jun 02, 2019 at 03:55:37PM +0530, Deepak Mishra wrote:
> This patch fixes CamelCase blnEnableRxFF0Filter by renaming it
> to enable_rx_ff0_filter in drv_types.h and related files rtl871x_cmd.c
> xmit_linux.c
> It was reported by checkpatch.pl
> 
> This fix also makes enable_rx_ff0_filter a bool and uses true false than
> previously used u8 as suggested by j...@perches.com
> 
> Signed-off-by: Deepak Mishra 
> ---
>  drivers/staging/rtl8712/drv_types.h   | 2 +-
>  drivers/staging/rtl8712/rtl871x_cmd.c | 2 +-
>  drivers/staging/rtl8712/xmit_linux.c  | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/rtl8712/drv_types.h 
> b/drivers/staging/rtl8712/drv_types.h
> index ddab6514a549..e3e2b32e964e 100644
> --- a/drivers/staging/rtl8712/drv_types.h
> +++ b/drivers/staging/rtl8712/drv_types.h
> @@ -164,7 +164,7 @@ struct _adapter {
>   struct iw_statistics iwstats;
>   int pid; /*process id from UI*/
>   struct work_struct wk_filter_rx_ff0;
> - u8 blnEnableRxFF0Filter;
> + bool enable_rx_ff0_filter;
>   spinlock_t lockRxFF0Filter;
>   const struct firmware *fw;
>   struct usb_interface *pusb_intf;
> diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c 
> b/drivers/staging/rtl8712/rtl871x_cmd.c
> index 05a78ac24987..6a8d58d97873 100644
> --- a/drivers/staging/rtl8712/rtl871x_cmd.c
> +++ b/drivers/staging/rtl8712/rtl871x_cmd.c
> @@ -238,7 +238,7 @@ u8 r8712_sitesurvey_cmd(struct _adapter *padapter,
>   mod_timer(&pmlmepriv->scan_to_timer,
> jiffies + msecs_to_jiffies(SCANNING_TIMEOUT));
>   padapter->ledpriv.LedControlHandler(padapter, LED_CTL_SITE_SURVEY);
> - padapter->blnEnableRxFF0Filter = 0;
> + padapter->enable_rx_ff0_filter = false;
>   return _SUCCESS;
>  }
>  
> diff --git a/drivers/staging/rtl8712/xmit_linux.c 
> b/drivers/staging/rtl8712/xmit_linux.c
> index e65a51c7f372..9fa1abcf5e50 100644
> --- a/drivers/staging/rtl8712/xmit_linux.c
> +++ b/drivers/staging/rtl8712/xmit_linux.c
> @@ -103,11 +103,11 @@ void r8712_SetFilter(struct work_struct *work)
>   r8712_write8(padapter, 0x117, newvalue);
>  
>   spin_lock_irqsave(&padapter->lockRxFF0Filter, irqL);
> - padapter->blnEnableRxFF0Filter = 1;
> + padapter->enable_rx_ff0_filter = true;
>   spin_unlock_irqrestore(&padapter->lockRxFF0Filter, irqL);
>   do {
>   msleep(100);
> - } while (padapter->blnEnableRxFF0Filter == 1);
> + } while (padapter->enable_rx_ff0_filter == true);

That is horrible, and I'm amazed it ever even works.  Please fix this
properly, spinning on a random variable is not how you do
synchronization in the kernel.

thanks,

greg k-h


Re: [GIT PULL] SPDX update for 5.2-rc3 - round 2

2019-06-02 Thread Greg KH
On Sun, Jun 02, 2019 at 09:03:46PM +0900, Masahiro Yamada wrote:
> On Sun, Jun 2, 2019 at 4:17 PM Greg KH  wrote:
> >
> > The following changes since commit 2f4c53349961c8ca480193e47da4d44fdb8335a8:
> >
> >   Merge tag 'spdx-5.2-rc3-1' of 
> > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core 
> > (2019-05-31 08:34:32 -0700)
> >
> > are available in the Git repository at:
> >
> >   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 
> > tags/spdx-5.2-rc3-2
> >
> > for you to fetch changes up to 8e82fe2ab65a80b1526b285c661ab88cc5891e3a:
> >
> >   treewide: fix typos of SPDX-License-Identifier (2019-06-01 18:29:58 +0200)
> >
> > 
> > SPDX fixes for 5.2-rc3, round 2
> >
> > Here are just two small patches, that fix up some found SPDX identifier
> > issues.
> >
> > The first patch fixes an error in a previous SPDX fixup patch, that
> > causes build errors when doing 'make clean' on the tree (the fact that
> > almost no one noticed it reflects the fact that kernel developers don't
> > like doing that option very often...)
> 
> This paragraph is not precise.
> 
> Not only "make clean", but also the normal build is broken.
> In fact, ARCH=arm allmodconfig is broken.
> 
> 
> $ make -j8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- allmodconfig
>   [ snip ]
> $ make -j8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
>   [ snip ]
> drivers/crypto/ux500/cryp/Makefile:5: *** missing separator.  Stop.
> make[3]: *** [scripts/Makefile.build;489: drivers/crypto/ux500/cryp] Error 2
> make[2]: *** [scripts/Makefile.build;489: drivers/crypto/ux500] Error 2
> make[1]: *** [scripts/Makefile.build;489: drivers/crypto] Error 2
> make[1]: *** Waiting for unfinished jobs
> 
> 
> 
> The 0-day bot should check allmodconfig for all arches,
> but surprisingly it was not caught before the merge.

Ah, good catch, odd that 0-day missed it.  Maybe it is not building
32bit builds these days :(

> > The second patch fixes up a number of places in the tree where people
> > mistyped the string "SPDX-License-Identifier".  Given that people can
> > not even type their own name all the time without mistakes, this was
> > bound to happen, and odds are, we will have to add some type of check
> > for this to checkpatch.pl to catch this happening in the future.
> 
> checkpatch.pl already warns
> "Missing or malformed SPDX-License-Identifier tag"
> unless correctly typed "SPDX-License-Identifier" is found in the file.
> 
> No more check is needed for this, I think.

Ok, thanks, I thought it was not caught which is why it snuck in.

> Not all developers run scripts/checkpatch.pl before patch submission.
> Not all maintainers run scripts/checkpatch.pl before commit.

Very true :(

thanks,

greg k-h


Re: [GIT PULL] KVM fixes for 5.2-rc3

2019-06-02 Thread pr-tracker-bot
The pull request you sent on Sun,  2 Jun 2019 11:50:39 +0200:

> https://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/b44a1dd3f648a433c525efcdd6ba95ad89d50e27

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


Re: [GIT PULL] Please pull powerpc/linux.git powerpc-5.2-3 tag

2019-06-02 Thread pr-tracker-bot
The pull request you sent on Sun, 02 Jun 2019 21:05:12 +1000:

> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git 
> tags/powerpc-5.2-3

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/460b48a0fefce25beb0fc0139e721c5691d65d7f

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


Re: [PULL REQUEST] i2c for 5.2

2019-06-02 Thread pr-tracker-bot
The pull request you sent on Sun, 2 Jun 2019 08:24:02 +0200:

> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-current

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/38baf0bb79f51b4fcbf6df8fd181441d7b5c7913

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


Re: [GIT PULL] Thermal-SoC management fixes for v5.2-rc3

2019-06-02 Thread pr-tracker-bot
The pull request you sent on Sat, 1 Jun 2019 16:22:06 -0700:

> git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal fixes

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/378e853f68e9a9548c64687880715ac3cca31c22

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


Re: [GIT PULL] SPDX update for 5.2-rc3 - round 2

2019-06-02 Thread pr-tracker-bot
The pull request you sent on Sun, 2 Jun 2019 08:39:05 +0200:

> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git 
> tags/spdx-5.2-rc3-2

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/a68dc6188242e1cc6f72eb3361e71633b4bc02a7

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


Re: [GIT PULL] LED fix for 5.2-rc3

2019-06-02 Thread pr-tracker-bot
The pull request you sent on Sat,  1 Jun 2019 19:59:44 +0200:

> git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git 
> tags/led-fixes-for-5.2-rc3

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/f58c356ea74feef8c2bb774dd19ded91567a5cf2

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker


  1   2   3   4   >