[PATCH 09/10] i2c: pasemi: Add Apple platform driver

2021-09-26 Thread Sven Peter
With all the previous preparations we can now finally add the platform driver to support the PASemi-based controllers in Apple SoCs. This does not work on the M1 yet but should work on the early iPhones already. Signed-off-by: Sven Peter --- MAINTAINERS | 1 +

[PATCH 00/10] Add Apple M1 support to PASemi i2c driver

2021-09-26 Thread Sven Peter
Hi, This series adds support for the I2C controller found on Apple Silicon Macs which has quite a bit of history: Apple bought P.A. Semi in 2008 and it looks like a part of its legacy continues to live on in the M1. This controller has actually been used since at least the iPhone 4S and hasn't

[PATCH 04/10] i2c: pasemi: Split off common probing code

2021-09-26 Thread Sven Peter
Split off common probing code that will be used by both the PCI and the platform device. Signed-off-by: Sven Peter --- drivers/i2c/busses/i2c-pasemi.c | 39 + 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/drivers/i2c/busses/i2c-pasemi.c

[PATCH 08/10] i2c: pasemi: Refactor _probe to use devm_*

2021-09-26 Thread Sven Peter
Using managed device resources means there's nothing left to be done in pasemi_smb_pci_remove and also allows to remove base and size from struct pasemi_smbus. Signed-off-by: Sven Peter --- drivers/i2c/busses/i2c-pasemi-core.c | 10 +++ drivers/i2c/busses/i2c-pasemi-core.h | 2 --

[PATCH 02/10] i2c: pasemi: Use io{read,write}32

2021-09-26 Thread Sven Peter
In preparation for splitting this driver up into a platform_driver and a pci_driver, replace outl/inl usage with ioport_map and ioread32/iowrite32. Signed-off-by: Sven Peter --- drivers/i2c/busses/i2c-pasemi.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git

Add Apple M1 support to PASemi i2c driver

2021-09-26 Thread Christian Zigotzky
Hi Sven, Thanks a lot for your nice explanation of the history of the PASemi i2c driver. We are using Nemo boards with 64-bit dual-core PWRficient PA6T-1682M CPUs (A-EON AmigaOne X1000). [1] The RC2 of kernel 5.15 works without any problems on our Nemo boards. [2] Could you please post

[PATCH 01/10] dt-bindings: i2c: Add Apple I2C controller bindings

2021-09-26 Thread Sven Peter
The Apple I2C controller is based on the PASemi I2C controller. It is present on Apple SoCs such as the M1. Signed-off-by: Sven Peter --- .../devicetree/bindings/i2c/apple,i2c.yaml| 61 +++ MAINTAINERS | 1 + 2 files changed, 62

[PATCH 07/10] i2c: pasemi: Allow to configure bus frequency

2021-09-26 Thread Sven Peter
Right now the bus frequency has always been hardcoded as 100 KHz with the specific reference clock used in the PASemi PCI controllers. Make this configurable to prepare for the platform driver. Signed-off-by: Sven Peter --- drivers/i2c/busses/i2c-pasemi-core.c | 8 +++-

[PATCH 03/10] i2c: pasemi: Remove usage of pci_dev

2021-09-26 Thread Sven Peter
Prepare to create a platform driver by removing all usages of pci_dev we can. Signed-off-by: Sven Peter --- drivers/i2c/busses/i2c-pasemi.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-pasemi.c b/drivers/i2c/busses/i2c-pasemi.c index

Re: Add Apple M1 support to PASemi i2c driver

2021-09-26 Thread Christian Zigotzky
Hi Sven, I can't apply your patch 5 (i2c: pasemi: Split pci driver to its own file). [1] Error message: patching file b/drivers/i2c/busses/i2c-pasemi-core.c (renamed from a/drivers/i2c/busses/i2c-pasemi.c) Hunk #3 FAILED at 344. 1 out of 3 hunks FAILED -- saving rejects to file

[PATCH 05/10] i2c: pasemi: Split pci driver to its own file

2021-09-26 Thread Sven Peter
Split off the PCI driver so that we can reuse common code for the platform driver. Signed-off-by: Sven Peter --- drivers/i2c/busses/Makefile | 1 + .../{i2c-pasemi.c => i2c-pasemi-core.c} | 88 + drivers/i2c/busses/i2c-pasemi-core.h | 19

[PATCH 10/10] i2c: pasemi: Set enable bit for Apple variant

2021-09-26 Thread Sven Peter
Some later revisions after the original PASemi I2C controller introduce what likely is an enable bit to the CTL register. Without setting it the actual i2c transmission is never started. Signed-off-by: Sven Peter --- drivers/i2c/busses/i2c-pasemi-core.c | 8

[PATCH 06/10] i2c: pasemi: Move common reset code to own function

2021-09-26 Thread Sven Peter
Split out common reset call to its own function so that we can later add support for selecting the clock frequency and an additional enable bit found in newer revisions. Signed-off-by: Sven Peter --- drivers/i2c/busses/i2c-pasemi-core.c | 15 +-- 1 file changed, 9 insertions(+), 6

Re: [PATCH] mm: Remove HARDENED_USERCOPY_FALLBACK

2021-09-26 Thread David Rientjes
On Tue, 21 Sep 2021, Stephen Kitt wrote: > This has served its purpose and is no longer used. All usercopy > violations appear to have been handled by now, any remaining > instances (or new bugs) will cause copies to be rejected. > > This isn't a direct revert of commit 2d891fbc3bb6 ("usercopy:

[PATCH] powerpc/eeh:Fix some mistakes in comments

2021-09-26 Thread Kai Song
Get rid of warning: arch/powerpc/kernel/eeh.c:774: warning: expecting prototype for eeh_set_pe_freset(). Prototype was for eeh_set_dev_freset() instead Signed-off-by: Kai Song --- arch/powerpc/kernel/eeh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH] ibmveth: Use dma_alloc_coherent() instead of kmalloc/dma_map_single()

2021-09-26 Thread Cai Huoqing
Replacing kmalloc/kfree/dma_map_single/dma_unmap_single() with dma_alloc_coherent/dma_free_coherent() helps to reduce code size, and simplify the code, and coherent DMA will not clear the cache every time. Signed-off-by: Cai Huoqing --- drivers/net/ethernet/ibm/Kconfig | 4 ++--

Re: [PATCH] powerpc:85xx: fix timebase sync issue when CONFIG_HOTPLUG_CPU=n

2021-09-26 Thread Xiaoming Ni
On 2021/9/26 10:51, Xiaoming Ni wrote: When CONFIG_SMP=y, timebase synchronization is required when the second kernel is started. arch/powerpc/kernel/smp.c: int __cpu_up(unsigned int cpu, struct task_struct *tidle) { ... if

[PATCH v2] ibmveth: Use dma_alloc_coherent() instead of kmalloc/dma_map_single()

2021-09-26 Thread Cai Huoqing
Replacing kmalloc/kfree/dma_map_single/dma_unmap_single() with dma_alloc_coherent/dma_free_coherent() helps to reduce code size, and simplify the code, and coherent DMA will not clear the cache every time. Signed-off-by: Cai Huoqing --- v1->v2: Remove extra change in Kconfig

[PATCH v3 0/9] sections: Unify kernel sections range check and use

2021-09-26 Thread Kefeng Wang
There are three head files(kallsyms.h, kernel.h and sections.h) which include the kernel sections range check, let's make some cleanup and unify them. 1. cleanup arch specific text/data check and fix address boundary check in kallsyms.h 2. make all the basic/core kernel range check function

[PATCH v3 2/9] kallsyms: Fix address-checks for kernel related range

2021-09-26 Thread Kefeng Wang
The is_kernel_inittext/is_kernel_text/is_kernel function should not include the end address(the labels _einittext, _etext and _end) when check the address range, the issue exists since Linux v2.6.12. Cc: Arnd Bergmann Cc: Sergey Senozhatsky Cc: Petr Mladek Reviewed-by: Petr Mladek

[PATCH v3 7/9] mm: kasan: Use is_kernel() helper

2021-09-26 Thread Kefeng Wang
Directly use is_kernel() helper in kernel_or_module_addr(). Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitry Vyukov Signed-off-by: Kefeng Wang --- mm/kasan/report.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kasan/report.c

[PATCH v3 3/9] sections: Move and rename core_kernel_data() to is_kernel_core_data()

2021-09-26 Thread Kefeng Wang
Move core_kernel_data() into sections.h and rename it to is_kernel_core_data(), also make it return bool value, then update all the callers. Cc: Arnd Bergmann Cc: Steven Rostedt Cc: Ingo Molnar Cc: "David S. Miller" Signed-off-by: Kefeng Wang --- include/asm-generic/sections.h | 16

[PATCH v3 4/9] sections: Move is_kernel_inittext() into sections.h

2021-09-26 Thread Kefeng Wang
The is_kernel_inittext() and init_kernel_text() are with same functionality, let's just keep is_kernel_inittext() and move it into sections.h, then update all the callers. Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Arnd Bergmann Cc: x...@kernel.org Signed-off-by: Kefeng Wang ---

[PATCH v3 5/9] x86: mm: Rename __is_kernel_text() to is_x86_32_kernel_text()

2021-09-26 Thread Kefeng Wang
Commit b56cd05c55a1 ("x86/mm: Rename is_kernel_text to __is_kernel_text"), add '__' prefix not to get in conflict with existing is_kernel_text() in . We will add __is_kernel_text() for the basic kernel text range check in the next patch, so use private is_x86_32_kernel_text() naming for x86

[PATCH v3 1/9] kallsyms: Remove arch specific text and data check

2021-09-26 Thread Kefeng Wang
After commit 4ba66a976072 ("arch: remove blackfin port"), no need arch-specific text/data check. Cc: Arnd Bergmann Signed-off-by: Kefeng Wang --- include/asm-generic/sections.h | 16 include/linux/kallsyms.h | 3 +-- kernel/locking/lockdep.c | 3 --- 3 files

[PATCH v3 8/9] extable: Use is_kernel_text() helper

2021-09-26 Thread Kefeng Wang
The core_kernel_text() should check the gate area, as it is part of kernel text range. Cc: Steven Rostedt Signed-off-by: Kefeng Wang --- kernel/extable.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/extable.c b/kernel/extable.c index 98ca627ac5ef..0ba383d850ff

[PATCH v3 9/9] powerpc/mm: Use is_kernel_text() and is_kernel_inittext() helper

2021-09-26 Thread Kefeng Wang
Use is_kernel_text() and is_kernel_inittext() helper to simplify code, also drop etext, _stext, _sinittext, _einittext declaration which already declared in section.h. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Kefeng

[PATCH v3 6/9] sections: Provide internal __is_kernel() and __is_kernel_text() helper

2021-09-26 Thread Kefeng Wang
An internal __is_kernel() helper which only check the kernel address ranges, and an internal __is_kernel_text() helper which only check text section ranges. Signed-off-by: Kefeng Wang --- include/asm-generic/sections.h | 29 + include/linux/kallsyms.h | 4 ++--