[PATCH 0/9 v2] usb: usb251xb: Add USB2517i hub support and fix some bugs

2017-09-16 Thread Serge Semin
{bus,self}-max-{power,curret} dts properties - Replace legacy GPIO API usage with descriptor-based one Changelog v2: - Split first patch into smaller ones - Fix invalid BOOST_14 register definition - Combine copyrights adding patch into the last one Serge Semin (9): usb: usb251xb: Add USB2517i

[PATCH 2/9 v2] usb: usb251xb: Add USB251x specific port count setting

2017-09-16 Thread Serge Semin
be checked whether it doesn't get out of available ports. Signed-off-by: Serge Semin --- drivers/usb/misc/usb251xb.c | 21 ++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 96a8c20ac..5cb0e5570

[PATCH 6/9 v2] usb: usb251xb: Add USB2517 LED settings

2017-09-16 Thread Serge Semin
USB2517 supports two LED modes: USB mode (default) and speed indication mode. The last one can be switched on by corresponding dts property. Since USB251xb hubs doesn't support LEDs settings, we need to ignore this setting. Signed-off-by: Serge Semin --- Documentation/devicetree/bindings/usb

[PATCH 8/9 v2] usb: usb251xb: Add max power/current dts property support

2017-09-16 Thread Serge Semin
This parameters may be varied in accordance with hardware specifics. So lets add the corresponding settings to the usb251x driver dts specification. Signed-off-by: Serge Semin --- Documentation/devicetree/bindings/usb/usb251xb.txt | 6 ++ drivers/usb/misc/usb251xb.c

[PATCH 7/9 v2] usb: usb251xb: Fix property_u32 NULL pointer dereference

2017-09-16 Thread Serge Semin
The methods like of_property_read_u32 utilizing the specified pointer permit only the pointer to a preallocated u32 storage as the third argument. As a result the driver crashes on NULL pointer dereference in case if "oc-delay-us" or "power-on-time-ms" declared in dts file.

[PATCH 9/9 v2] usb: usb251xb: Use GPIO descriptor consumer interface

2017-09-16 Thread Serge Semin
including the logical value inversion. Secondly, by requesting the reset GPIO descriptor the driver prevent the other applications from changing its value. And last but not least the legacy GPIO interface should be avoided in the new code due to it obsolescence. Signed-off-by: Serge Semin

[PATCH 5/9 v2] usb: usb251xb: Add battery enable setting flag

2017-09-16 Thread Serge Semin
in the driver, but still can be helpful in future, when necessity of corresponding dts setting arises. Signed-off-by: Serge Semin --- drivers/usb/misc/usb251xb.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 44fa7d084

[PATCH 4/9 v2] usb: usb251xb: Add 5,6,7 ports boost settings

2017-09-16 Thread Serge Semin
-by: Serge Semin --- drivers/usb/misc/usb251xb.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 3de0de93b..44fa7d084 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -94,8

[PATCH 1/9 v2] usb: usb251xb: Add USB2517i specific struct and IDs

2017-09-16 Thread Serge Semin
on i2c-bus. Signed-off-by: Serge Semin --- Documentation/devicetree/bindings/usb/usb251xb.txt | 3 ++- drivers/usb/misc/usb251xb.c | 21 - 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/usb

[PATCH 3/9 v2] usb: usb251xb: Add 5,6,7 ports mapping def setting

2017-09-16 Thread Serge Semin
USB2517 got three additionl downstream ports, which can as well be mapped to another logical ports. USB2551xb driver currently doesn't fully support such setting configuration from dts file. This patch doesn't change this, but adds usb2517 spcific ports default liner mapping. Signed-off-by: Serge

[PATCH v2 01/15] MIPS: memblock: Add RESERVED_NOMAP memory flag

2018-02-01 Thread Serge Semin
to be changed in the further patches. Signed-off-by: Serge Semin --- arch/mips/include/asm/bootinfo.h | 1 + arch/mips/kernel/prom.c | 8 ++-- arch/mips/kernel/setup.c | 8 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/arch/mips/include/asm/bootinfo.h b/arch

[PATCH v2 00/15] MIPS: memblock: Switch arch code to NO_BOOTMEM

2018-02-01 Thread Serge Semin
d replace %pK with %px there (requested by Matt Redfearn) - Drop relocatable fixup from reservation_init (patch from Matt Redfearn) - Move __maybe_unused change from patch 7 to patch 8 (requested by Marcin Nowakowski) - Add tested platforms to the cover letter Signed-off-by: Serge Semin Tested-b

[PATCH v2 04/15] MIPS: memblock: Discard bootmem initialization

2018-02-01 Thread Serge Semin
regions initialization the only thing left is to set the upper allocation limit to be up to the max low memory PFN, so the memblock API can be fully used from now. Signed-off-by: Serge Semin --- arch/mips/kernel/setup.c | 86 +++- 1 file changed, 11

[PATCH v2 02/15] MIPS: memblock: Surely map BSS kernel memory section

2018-02-01 Thread Serge Semin
The current MIPS code makes sure the kernel code/data/init sections are in the maps, but BSS should also be there. Signed-off-by: Serge Semin --- arch/mips/kernel/setup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index

[PATCH v2 03/15] MIPS: memblock: Reserve initrd memory in memblock

2018-02-01 Thread Serge Semin
There is no reserve_bootmem() method in the nobootmem interface, so we need to replace it with memblock-specific one. Signed-off-by: Serge Semin --- arch/mips/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c

[PATCH v2 14/15] MIPS: memblock: Discard bootmem from SGI IP27 code

2018-02-01 Thread Serge Semin
since I couldn't find a place where prom_meminit() called and kernel memory isn't reserved. It must have been untested since the time the arch/mips/mips-boards/generic code was in the kernel. Signed-off-by: Serge Semin --- arch/mips/sgi-ip27/ip27-memory.c | 9 ++--- 1 file changed, 2

[PATCH v2 15/15] MIPS: memblock: Deactivate bootmem allocator

2018-02-01 Thread Serge Semin
Memblock allocator can be successfully used from now for early memory management Signed-off-by: Serge Semin --- arch/mips/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 350a990fc719..434f756e03e9 100644 --- a/arch/mips

[PATCH v2 13/15] MIPS: memblock: Discard bootmem from Loongson3 code

2018-02-01 Thread Serge Semin
-by: Serge Semin --- arch/mips/loongson64/loongson-3/numa.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/arch/mips/loongson64/loongson-3/numa.c b/arch/mips/loongson64/loongson-3/numa.c index f17ef520799a..2f1ebf496c17 100644 --- a/arch/mips/loongson64

[PATCH v2 05/15] MIPS: KASLR: Drop relocatable fixup from reservation_init

2018-02-01 Thread Serge Semin
From: Matt Redfearn A recent change ("MIPS: memblock: Discard bootmem initialization") removed the reservation of all memory below the kernel's _end symbol in bootmem. This makes the call to free_bootmem unnecessary, since the memory region is no longer marked reserved. Additionally, ("MIPS:

[PATCH v2 11/15] MIPS: memblock: Perform early low memory test

2018-02-01 Thread Serge Semin
Low memory can be tested at this point, since all the reservations have just been finished without much of additional allocations. Signed-off-by: Serge Semin --- arch/mips/kernel/setup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c

[PATCH v2 12/15] MIPS: memblock: Print out kernel virtual mem layout

2018-02-01 Thread Serge Semin
It is useful to have the kernel virtual memory layout printed at boot time so to have the full information about the booted kernel. In some cases it might be unsafe to have virtual addresses freely visible in logs, so the %pK format is used if one want to hide them. Signed-off-by: Serge Semin

[PATCH v2 10/15] MIPS: memblock: Allow memblock regions resize

2018-02-01 Thread Serge Semin
When all the main reservations are done the memblock regions can be dynamically resized. Additionally it would be useful to have memblock regions dumped on debug at this point. Signed-off-by: Serge Semin --- arch/mips/kernel/setup.c | 4 1 file changed, 4 insertions(+) diff --git a/arch

[PATCH v2 09/15] MIPS: memblock: Simplify DMA contiguous reservation

2018-02-01 Thread Serge Semin
CMA reserves it areas in the memblock allocator. Since we aren't using bootmem anymore, the reservations copying should be discarded. Signed-off-by: Serge Semin --- arch/mips/kernel/setup.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/mips/kernel/setup.c b/arch

[PATCH v2 08/15] MIPS: memblock: Mark present sparsemem sections

2018-02-01 Thread Serge Semin
If sparsemem is activated all sections with present pages must be accordingly marked after memblock is fully initialized. Signed-off-by: Serge Semin --- arch/mips/kernel/setup.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index

[PATCH v2 06/15] MIPS: memblock: Add reserved memory regions to memblock

2018-02-01 Thread Serge Semin
the function description/code). Signed-off-by: Serge Semin --- arch/mips/kernel/setup.c | 96 +++- 1 file changed, 54 insertions(+), 42 deletions(-) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index cf3674977170..72853e94c2c7 100644

[PATCH v2 07/15] MIPS: memblock: Reserve kdump/crash regions in memblock

2018-02-01 Thread Serge Semin
Kdump/crashkernel memory regions should be reserved in the memblock allocator so they wouldn't be occupied by any further allocations. Signed-off-by: Serge Semin --- arch/mips/kernel/setup.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/mips/kernel/setup.c b

[PATCH v2 04/15] NTB: ntb_pp: Add full multi-port NTB API support

2017-12-03 Thread Serge Semin
-off-by: Serge Semin --- Changelog v1: - Add Multi-port API support - Ping-pong now works like cyclic ping around all the peers Changelog v2: - Remove driver Author/Description/Version macros drivers/ntb/test/ntb_pingpong.c | 450 +--- 1 file changed, 286

[PATCH v2 07/15] NTB: ntb_test: Safely use paths with whitespace

2017-12-03 Thread Serge Semin
If some of the variables like LOC/REM or LOCAL_*/REMOTE_* got whitespaces, the script may fail with syntax error. Signed-off-by: Serge Semin Acked-by: Logan Gunthorpe Fixes: a9c59ef77458 ("ntb_test: Add a selftest script for the NTB subsystem") --- tools/testing/selftests/ntb/ntb_te

[PATCH v2 03/15] NTB: Fix UB/bug in ntb_mw_get_align()

2017-12-03 Thread Serge Semin
in "linux/bitops.h" to perform the bit-set-shift operations, so it's recommended to have them used for proper bit setting. Signed-off-by: Serge Semin Reviewed-by: Logan Gunthorpe --- include/linux/ntb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/nt

[PATCH v2 14/15] NTB: ntb_test: Update ntb_perf tests

2017-12-03 Thread Serge Semin
ntb_perf driver has been also updated so to have the multi-port interface support. User now must specify what peer port is going to be used to perform the test. Signed-off-by: Serge Semin --- tools/testing/selftests/ntb/ntb_test.sh | 13 +++-- 1 file changed, 7 insertions(+), 6

[PATCH v2 09/15] NTB: ntb_test: Update ntb_tool link tests

2017-12-03 Thread Serge Semin
the link state. Such behaviour should be reflected in the test code. Signed-off-by: Serge Semin --- tools/testing/selftests/ntb/ntb_test.sh | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing

[PATCH v2 10/15] NTB: ntb_test: Update ntb_tool DB tests

2017-12-03 Thread Serge Semin
DB interface of ntb_tool driver hasn't been changed much, but db_valid_mask DebugFS file has still been added to new ntb_tool driver. In this case it's much better to test all valid DB bits instead of using the predefined mask, which may be incorrect in general. Signed-off-by: Serge Semin

[PATCH v2 13/15] NTB: ntb_test: Update ntb_tool MW tests

2017-12-03 Thread Serge Semin
previous Intel/AMD and new IDT-like devices. Signed-off-by: Serge Semin --- tools/testing/selftests/ntb/ntb_test.sh | 89 + 1 file changed, 68 insertions(+), 21 deletions(-) diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing/selftests/ntb/ntb_test.sh

[PATCH v2 15/15] NTB: ntb_hw_idt: Set NTB_TOPO_SWITCH topology

2017-12-03 Thread Serge Semin
Since Switchtec patch there has been a new topology added to the NTB API. It's called NTB_TOPO_SWITCH and dedicated for in general multi-port PCIe switch chips. Even though topo field isn't used within the IDT driver much, lets set it for the sake of unification. Signed-off-by: Serge Semin

[PATCH v2 11/15] NTB: ntb_test: Update ntb_tool Scratchpad tests

2017-12-03 Thread Serge Semin
Scratchpad NTB API has been changed so has the ntb_tool driver. Outbound Scratchpad DebugFS files have been moved to peer specific directories. Each scratchpad is now available via separate file. The test code has been accordingly altered. Signed-off-by: Serge Semin --- tools/testing/selftests

[PATCH v2 12/15] NTB: ntb_test: Add ntb_tool Message tests

2017-12-03 Thread Serge Semin
Messages NTB API is now available. ntb_tool driver has been altered to perform messages send and receive operations. The test of messages read/write to/from peer device has been added to the script. Signed-off-by: Serge Semin --- tools/testing/selftests/ntb/ntb_test.sh | 37

[PATCH v2 06/15] NTB: ntb_perf: Add full multi-port NTB API support

2017-12-03 Thread Serge Semin
. Signed-off-by: Serge Semin --- Changelog v1: - Alter interface in compliance with multi-port API - Create Scratchpads and Message compliant NTB link init process - Simplify memcpy and DMA-based tests process - Limit DebugFS access methods to prevent the driver failure Changelog v2: - Remove driver

[PATCH v2 02/15] NTB: Set dma mask and dma coherent mask to NTB devices

2017-12-03 Thread Serge Semin
to that ntb_device_register() method shouldn't clear the passed ntb_dev structure, since it dma_mask is initialized by hardware drivers. Signed-off-by: Serge Semin --- drivers/ntb/hw/amd/ntb_hw_amd.c | 4 drivers/ntb/hw/idt/ntb_hw_idt.c | 8 +++- drivers/ntb/hw/intel/ntb_hw_intel.c | 4

[PATCH v2 08/15] NTB: ntb_test: Add ntb_tool port tests

2017-12-03 Thread Serge Semin
to determine the local and peer ports as well as their indexes. Signed-off-by: Serge Semin --- tools/testing/selftests/ntb/ntb_test.sh | 52 + 1 file changed, 52 insertions(+) diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing/selftests/ntb

[PATCH v2 00/15] NTB: Add full multi-port API support to the test drivers

2017-12-03 Thread Serge Semin
. This patchset is intended to fix the issue, by amending the NTB test drivers and script so they would be fully compatible with multi-port NTB API. Additionally I found a few NTB subsystem issues while developing the submitted patches. So they are also fixed in this patchset. Serge Semin (15): NTB

[PATCH v2 05/15] NTB: ntb_tool: Add full multi-port NTB API support

2017-12-03 Thread Serge Semin
-by: Serge Semin --- Changelog v1: - Alter interface in compliance with multi-port API - Move Message/MW/Port/Link settings to a specific directory Changelog v2: - Remove driver Author/Description/License macros - Return error if ntb_mw_get_align called while link is down - Add db_valid_mask

[PATCH v2 01/15] NTB: Rename NTB messaging API methods

2017-12-03 Thread Serge Semin
so the developers won't be able to compile their code without being informed by the compiler. Signed-off-by: Serge Semin --- drivers/ntb/hw/idt/ntb_hw_idt.c | 27 --- include/linux/ntb.h | 34 -- 2 files changed, 28 insertions

Re: [PATCH v2 00/15] NTB: Add full multi-port API support to the test drivers

2017-12-03 Thread Serge Semin
On Sun, Dec 03, 2017 at 09:54:58PM -0700, Logan Gunthorpe wrote: > > > On 03/12/17 12:17 PM, Serge Semin wrote: > > The multi-port NTB API was introduced in kernel 4.13 as well as the > > first driver for the true multi-port devices of IDT PCIe-switches > > series.

[PATCH v2] NTB: Rename NTB messaging API methods

2017-11-30 Thread Serge Semin
There is a common methods signature form used over all the NTB API like functions naming scheme, arguments names and order, etc. Recently added NTB messaging API IO callbacks were named a bit different so should be renamed to be in compliance with the rest of the API. Signed-off-by: Serge Semin

[PATCH v2] NTB: ntb_pp: Add full multi-port NTB API support

2017-11-30 Thread Serge Semin
-off-by: Serge Semin --- Changelog v1: - Add Multi-port API support - Ping-pong now works like cyclic ping around all the peers Changelog v2: - Remove driver Author/Description/Version macros drivers/ntb/test/ntb_pingpong.c | 450 +--- 1 file changed, 286

[PATCH v2] NTB: ntb_tool: Add full multi-port NTB API support

2017-11-30 Thread Serge Semin
-by: Serge Semin --- Changelog v1: - Alter interface in compliance with multi-port API - Move Message/MW/Port/Link settings to a specific directory Changelog v2: - Remove driver Author/Description/License macros - Return error if ntb_mw_get_align called while link is down - Add db_valid_mask

[PATCH v2] NTB: ntb_perf: Add full multi-port NTB API support

2017-11-30 Thread Serge Semin
. Signed-off-by: Serge Semin --- Changelog v1: - Alter interface in compliance with multi-port API - Create Scratchpads and Message compliant NTB link init process - Simplify memcpy and DMA-based tests process - Limit DebugFS access methods to prevent the driver failure Changelog v2: - Remove driver

[PATCH] NTB: Fix UB/bug in ntb_mw_get_align()

2017-11-30 Thread Serge Semin
in "linux/bitops.h" to perform the bit-set-shift operations, so it's recommended to have them used for proper bit setting. Signed-off-by: Serge Semin --- include/linux/ntb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/ntb.h b/include/linux/ntb.h

[PATCH] NTB: Set dma mask and dma coherent mask to NTB devices

2017-11-30 Thread Serge Semin
to that ntb_device_register() method shouldn't clear the passed ntb_dev structure, since it dma_mask is initialized by hardware drivers. Signed-off-by: Serge Semin --- drivers/ntb/hw/amd/ntb_hw_amd.c | 4 drivers/ntb/hw/idt/ntb_hw_idt.c | 8 +++- drivers/ntb/hw/intel/ntb_hw_intel.c | 4 drivers

[PATCH] NTB: ntb_hw_idt: Set NTB_TOPO_SWITCH topology

2017-11-30 Thread Serge Semin
Since Switchtec patch there has been a new topology added to the NTB API. It's called NTB_TOPO_SWITCH and dedicated for PCIe switch chips. Even though topo field isn't used within the IDT driver much, lets set it for the sake of unification. Signed-off-by: Serge Semin Acked-by: Serge Semin

[PATCH 02/08] NTB: ntb_test: Add ntb_tool port tests

2017-11-30 Thread Serge Semin
the local and peer ports as well as their indexes. Signed-off-by: Serge Semin --- tools/testing/selftests/ntb/ntb_test.sh | 52 + 1 file changed, 52 insertions(+) diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing/selftests/ntb/ntb_test.sh index

[PATCH 04/08] NTB: ntb_test: Update ntb_tool DB tests

2017-11-30 Thread Serge Semin
DB interface of ntb_tool driver hasn't been changed much, but db_valid_mask DebugFS file has still been added. In this case it's much better to test all valid DB bits instead of using the predefined mask, which may be incorrect in general. Signed-off-by: Serge Semin --- tools/testing/selftests

[PATCH 06/08] NTB: ntb_test: Add ntb_tool Message tests

2017-11-30 Thread Serge Semin
Messages NTB API is now available. ntb_tool driver has been altered to perform messages send and receive operation. The test of messages read/write to/from peer device has been added to the script. Signed-off-by: Serge Semin --- tools/testing/selftests/ntb/ntb_test.sh | 37

[PATCH 08/08] NTB: ntb_test: Update ntb_perf tests

2017-11-30 Thread Serge Semin
ntb_perf driver has been also updated so to have the multi-port interface support. User now must specify what peer port is going to be used to perform the test. Signed-off-by: Serge Semin --- tools/testing/selftests/ntb/ntb_test.sh | 13 +++-- 1 file changed, 7 insertions(+), 6

[PATCH 07/08] NTB: ntb_test: Update ntb_tool MW tests

2017-11-30 Thread Serge Semin
previous Intel/AMD and new IDT-like devices. Signed-off-by: Serge Semin --- tools/testing/selftests/ntb/ntb_test.sh | 89 + 1 file changed, 68 insertions(+), 21 deletions(-) diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing/selftests/ntb/ntb_test.sh

[PATCH 05/08] NTB: ntb_test: Update ntb_tool Scratchpad tests

2017-11-30 Thread Serge Semin
Scratchpad NTB API has changed so has the ntb_tool driver. Outbound Scratchpad DebugFS files have been moved to peer specific directories. Each scratchpad is now available via separate file. The test code has been accordingly altered. Signed-off-by: Serge Semin --- tools/testing/selftests/ntb

[PATCH 03/08] NTB: ntb_test: Update ntb_tool link tests

2017-11-30 Thread Serge Semin
the link state. Such behaviour should be reflected in the test code. Signed-off-by: Serge Semin --- tools/testing/selftests/ntb/ntb_test.sh | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing

[PATCH 01/08] NTB: ntb_test: Safely use paths with whitespace

2017-11-30 Thread Serge Semin
If some of variables like LOC/REM or LOCAL_*/REMOTE_* got whitespaces, the script may fail with syntax error. Signed-off-by: Serge Semin --- tools/testing/selftests/ntb/ntb_test.sh | 62 - 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/tools

Re: [PATCH 01/08] NTB: ntb_test: Safely use paths with whitespace

2017-11-30 Thread Serge Semin
re maintainers. Sorry for not mentioning it in the cover letter. -Sergey > > On 30/11/17 02:42 PM, Serge Semin wrote: > >If some of variables like LOC/REM or LOCAL_*/REMOTE_* got > >whitespaces, the script may fail with syntax error. > > > >Signed-off-by: Serge Semin >

Re: [PATCH] NTB: ntb_hw_idt: Set NTB_TOPO_SWITCH topology

2017-11-30 Thread Serge Semin
On Thu, Nov 30, 2017 at 03:06:15PM -0700, Logan Gunthorpe wrote: > > > On 30/11/17 02:41 PM, Serge Semin wrote: > >Since Switchtec patch there has been a new topology added to > >the NTB API. It's called NTB_TOPO_SWITCH and dedicated for > >PCIe switch chips. Even t

Re: [PATCH v1] gpio: dwapb: mask/unmask IRQ when disable/enable it

2021-01-07 Thread Serge Semin
> > > > > On 2020/12/7 2:50, Marc Zyngier wrote: > > > > On 2020-12-06 15:02, Linus Walleij wrote: > > > >> On Sat, Dec 5, 2020 at 11:15 PM Serge Semin > > > >> wrote: > > > >> > > > >>> Hmm, that sound

Re: [PATCH v3 02/21] spi: dw: Add DWC SSI capability

2020-10-02 Thread Serge Semin
On Fri, Oct 02, 2020 at 01:19:29PM +0300, Andy Shevchenko wrote: > On Fri, Oct 02, 2020 at 01:28:10AM +0300, Serge Semin wrote: > > Currently DWC SSI core is supported by means of setting up the > > core-specific update_cr0() callback. It isn't suitable for multiple > >

Re: [PATCH v3 03/21] spi: dw: Detach SPI device specific CR0 config method

2020-10-02 Thread Serge Semin
On Fri, Oct 02, 2020 at 01:22:46PM +0300, Andy Shevchenko wrote: > On Fri, Oct 02, 2020 at 01:28:11AM +0300, Serge Semin wrote: > > Indeed there is no point in detecting the SPI peripheral device parameters > > and initializing the CR0 register fields each time an SPI transfer

Re: [PATCH v3 02/21] spi: dw: Add DWC SSI capability

2020-10-02 Thread Serge Semin
On Fri, Oct 02, 2020 at 09:26:07PM +0300, Andy Shevchenko wrote: > On Fri, Oct 2, 2020 at 8:18 PM Serge Semin > wrote: > > > > On Fri, Oct 02, 2020 at 01:19:29PM +0300, Andy Shevchenko wrote: > > > On Fri, Oct 02, 2020 at 01:28:10AM +0300, Serge Semin wrote: >

Re: [PATCH v3 03/21] spi: dw: Detach SPI device specific CR0 config method

2020-10-02 Thread Serge Semin
On Fri, Oct 02, 2020 at 09:24:55PM +0300, Andy Shevchenko wrote: > On Fri, Oct 2, 2020 at 8:47 PM Serge Semin > wrote: > > On Fri, Oct 02, 2020 at 01:22:46PM +0300, Andy Shevchenko wrote: > > > On Fri, Oct 02, 2020 at 01:28:11AM +0300, Serge Semin wrote: > > > &g

Re: [PATCH v3 02/21] spi: dw: Add DWC SSI capability

2020-10-02 Thread Serge Semin
On Fri, Oct 02, 2020 at 10:46:09PM +0300, Serge Semin wrote: > On Fri, Oct 02, 2020 at 09:26:07PM +0300, Andy Shevchenko wrote: > > On Fri, Oct 2, 2020 at 8:18 PM Serge Semin > > wrote: > > > > > > On Fri, Oct 02, 2020 at 01:19:29PM +0300, Andy Shevchenko wrote: &

Re: [PATCH v3 02/21] spi: dw: Add DWC SSI capability

2020-10-02 Thread Serge Semin
On Fri, Oct 02, 2020 at 11:08:29PM +0300, Serge Semin wrote: > On Fri, Oct 02, 2020 at 10:46:09PM +0300, Serge Semin wrote: > > On Fri, Oct 02, 2020 at 09:26:07PM +0300, Andy Shevchenko wrote: > > > On Fri, Oct 2, 2020 at 8:18 PM Serge Semin > > > wrote: > > >

[PATCH] MAINTAINERS: Add maintainer of DW APB SSI driver

2020-10-02 Thread Serge Semin
Add myself as a maintainer of the Synopsis DesignWare APB SSI driver. Suggested-by: Andy Shevchenko Signed-off-by: Serge Semin Link: https://lore.kernel.org/linux-spi/20201001222829.15977-1-sergey.se...@baikalelectronics.ru/ --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff

Re: [PATCH 0/3] serial: 8250_dw: Fix clk-notifier/port suspend deadlock

2020-09-29 Thread Serge Semin
Hello, On Sun, Sep 27, 2020 at 05:01:52PM +0200, Hans de Goede wrote: > Hi, > > On 9/23/20 6:19 PM, Serge Semin wrote: > > Hans has discovered that there is a potential deadlock between the ref > > clock change notifier and the port suspension procedures {see the l

Re: [PATCH 0/2] mips: Introduce some IO-accessors optimizations

2020-09-29 Thread Serge Semin
Thomas, Any comment on the series? The changes aren't that comprehensive, so it would be great to merge it in before the 5.10 merge window is opened. -Sergey On Sun, Sep 20, 2020 at 02:00:08PM +0300, Serge Semin wrote: > It has been discovered that on our MIPS P5600-based CPU the IO access

Re: [PATCH 02/30] spi: dw: Use ternary op to init set_cs callback

2020-09-29 Thread Serge Semin
On Tue, Sep 29, 2020 at 02:11:53PM +0100, Mark Brown wrote: > On Sun, Sep 20, 2020 at 02:28:46PM +0300, Serge Semin wrote: > > Simplify the dw_spi_add_host() method a bit by replacing the set_cs > > callback overwrite procedure with direct setting the callback if a custom >

Re: [PATCH 03/30] spi: dw: Initialize n_bytes before the memory barrier

2020-09-29 Thread Serge Semin
On Tue, Sep 29, 2020 at 02:12:25PM +0100, Mark Brown wrote: > On Sun, Sep 20, 2020 at 02:28:47PM +0300, Serge Semin wrote: > > Since n_bytes field of the DW SPI private data is also utilized by the > > IRQ handler, we need to make sure it' initialization is done before the >

Re: [PATCH 04/30] Revert: spi: spi-dw: Add lock protect dw_spi rx/tx to prevent concurrent calls

2020-09-29 Thread Serge Semin
On Tue, Sep 29, 2020 at 02:28:11PM +0100, Mark Brown wrote: > On Sun, Sep 20, 2020 at 02:28:48PM +0300, Serge Semin wrote: > > There is no point in having the commit 19b61392c5a8 ("spi: spi-dw: Add > > lock protect dw_spi rx/tx to prevent concurrent calls") applied. T

Re: [PATCH 11/30] spi: dw: Add DWC SSI capability

2020-09-29 Thread Serge Semin
On Tue, Sep 29, 2020 at 02:52:33PM +0100, Mark Brown wrote: > On Sun, Sep 20, 2020 at 02:28:55PM +0300, Serge Semin wrote: > > > - /* > > -* SPI mode (SCPOL|SCPH) > > -* CTRLR0[ 8] Serial Clock Phase > > -* CTRLR0[ 9] Serial Clock Polarity > >

Re: [PATCH 00/30] spi: dw: Add full Baikal-T1 SPI Controllers support

2020-09-29 Thread Serge Semin
Hi Mark On Tue, Sep 29, 2020 at 03:43:51PM +0100, Mark Brown wrote: > On Sun, Sep 20, 2020 at 02:28:44PM +0300, Serge Semin wrote: > > > First two patches are just cleanups to simplify the DW APB SSI device > > initialization a bit. We suggest to discard the IRQ threshold m

Re: [PATCH 00/30] spi: dw: Add full Baikal-T1 SPI Controllers support

2020-09-30 Thread Serge Semin
On Wed, Sep 30, 2020 at 12:04:04PM +0100, Mark Brown wrote: > On Wed, Sep 30, 2020 at 01:43:03AM +0300, Serge Semin wrote: > > On Tue, Sep 29, 2020 at 03:43:51PM +0100, Mark Brown wrote: > > > > This is a *huge* patch series which is a bit unweildy to review > > >

Re: [PATCH 0/2] mips: Introduce some IO-accessors optimizations

2020-09-30 Thread Serge Semin
On Wed, Sep 30, 2020 at 12:15:32PM +0200, Thomas Bogendoerfer wrote: > On Wed, Sep 30, 2020 at 12:12:32AM +0300, Serge Semin wrote: > > Thomas, > > Any comment on the series? The changes aren't that comprehensive, so it > > would > > be great to merge it in before the

Re: [PATCH 02/30] spi: dw: Use ternary op to init set_cs callback

2020-09-30 Thread Serge Semin
Mark, A concrete question is below the main text.) On Wed, Sep 30, 2020 at 12:55:55AM +0300, Serge Semin wrote: > On Tue, Sep 29, 2020 at 02:11:53PM +0100, Mark Brown wrote: > > On Sun, Sep 20, 2020 at 02:28:46PM +0300, Serge Semin wrote: > > > Simplify the dw_spi_add_h

Re: [PATCH 11/30] spi: dw: Add DWC SSI capability

2020-09-30 Thread Serge Semin
Mark, A concrete question is below of my previous comment. On Wed, Sep 30, 2020 at 01:17:37AM +0300, Serge Semin wrote: > On Tue, Sep 29, 2020 at 02:52:33PM +0100, Mark Brown wrote: > > On Sun, Sep 20, 2020 at 02:28:55PM +0300, Serge Semin wrote: > > > > > - /* > &g

Re: [PATCH 02/30] spi: dw: Use ternary op to init set_cs callback

2020-09-30 Thread Serge Semin
On Wed, Sep 30, 2020 at 04:01:17PM +0100, Mark Brown wrote: > On Wed, Sep 30, 2020 at 05:57:59PM +0300, Serge Semin wrote: > > On Wed, Sep 30, 2020 at 12:55:55AM +0300, Serge Semin wrote: > > > > + if (dws->set_cs) > > > + master->set_cs = dws->set_

Re: [PATCH 11/30] spi: dw: Add DWC SSI capability

2020-09-30 Thread Serge Semin
On Wed, Sep 30, 2020 at 04:41:49PM +0100, Mark Brown wrote: > On Wed, Sep 30, 2020 at 06:03:12PM +0300, Serge Semin wrote: > > On Wed, Sep 30, 2020 at 01:17:37AM +0300, Serge Semin wrote: > > > > > > - /* > > > > > - * SPI mode (SCPOL|SCPH)

[PATCH v2 07/21] spi: dw: Add DW SPI controller config structure

2020-09-30 Thread Serge Semin
driver, but by the glue layer drivers too. This will be required in a coming further commit. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 29 + drivers/spi/spi-dw.h | 10 ++ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git

[PATCH v2 08/21] spi: dw: Refactor data IO procedure

2020-09-30 Thread Serge Semin
and there in the tx_max(), rx_max(), dw_writer() and dw_reader() methods. Such modification will not only give us the more optimized IO procedures, but will make the data IO methods much more readable than before. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 37

[PATCH v2 04/21] spi: dw: Update SPI bus speed in a config function

2020-09-30 Thread Serge Semin
to have a generic function name not related to CR0. Leave the too long line with the chip->clk_div setting as is for now, since it's going to be changed later anyway. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 28 ++-- 1 file changed, 14 insertions(+),

[PATCH v2 17/21] spi: dw: Add memory operations support

2020-09-30 Thread Serge Semin
controller with fixed automatic CS toggle functionality. Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin --- drivers/spi/Kconfig | 1 + drivers/spi/spi-dw-core.c | 300 ++ drivers/spi/spi-dw.h | 13 ++ 3 files

[PATCH v2 20/21] dt-bindings: spi: dw: Add Baikal-T1 SPI Controllers

2020-09-30 Thread Serge Semin
-off-by: Serge Semin Reviewed-by: Rob Herring --- .../bindings/spi/snps,dw-apb-ssi.yaml | 33 +-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml b/Documentation/devicetree/bindings/spi/snps,dw-apb

[PATCH v2 11/21] spi: dw: Unmask IRQs after enabling the chip

2020-09-30 Thread Serge Semin
st in case... Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index db3fec4195f7..58a7c7465c61 100644 --- a/drivers/spi/spi-dw-core.c +++ b/drivers/spi/spi

[PATCH v2 02/21] spi: dw: Add DWC SSI capability

2020-09-30 Thread Serge Semin
controller setup to make the dw_spi_update_cr0() method looking coherent. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 80 ++- drivers/spi/spi-dw-mmio.c | 20 +- drivers/spi/spi-dw.h | 9 + 3 files changed, 40 insertions(+), 69

[PATCH v2 06/21] spi: dw: Update Rx sample delay in the config function

2020-09-30 Thread Serge Semin
Rx sample delay can be SPI device specific, and should be synchronously initialized with the rest of the communication and peripheral device related controller setups. So let's move the Rx-sample delay setup into the DW APB SSI configuration update method. Signed-off-by: Serge Semin --- drivers

[PATCH v2 12/21] spi: dw: Discard chip enabling on DMA setup error

2020-09-30 Thread Serge Semin
returned from the dma_setup callback to be erroneous as it's supposed to be in the kernel. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index 58a7c7465c61

[PATCH v2 00/21] spi: dw: Add full Baikal-T1 SPI Controllers support

2020-09-30 Thread Serge Semin
ATCH 00/04] spi: dw: Clear IRQ status on DW SPI controller reset [PATCH 00/03] spi: dw: Initialize n_bytes before the memory barrier [PATCH 00/01] spi: dw: Discard IRQ threshold macro Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Ramil Zaripov Cc: Pavel Parkhomenko Cc: Andy Shevchenko

[PATCH v2 21/21] spi: dw: Add Baikal-T1 SPI Controller glue driver

2020-09-30 Thread Serge Semin
of the DW SPI core module. Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin --- drivers/spi/Kconfig | 28 drivers/spi/Makefile | 1 + drivers/spi/spi-dw-bt1.c | 339 +++ 3 files changed, 368 insertions

[PATCH v2 01/21] spi: dw: Use an explicit set_cs assignment

2020-09-30 Thread Serge Semin
Simplify the dw_spi_add_host() method a bit by replacing the currently implemented default set_cs callback setting up and later having it overwritten by a custom function with direct if-else-based callback assignment. Signed-off-by: Serge Semin --- Changelog v2: - Replace the ternary operator

[PATCH v2 15/21] spi: dw: Move num-of retries parameter to the header file

2020-09-30 Thread Serge Semin
The parameter will be needed for another wait-done method being added in the framework of the SPI memory operation modification in a further commit. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-dma.c | 5 ++--- drivers/spi/spi-dw.h | 2 ++ 2 files changed, 4 insertions(+), 3 deletions

[PATCH v2 14/21] spi: dw: Explicitly de-assert CS on SPI transfer completion

2020-09-30 Thread Serge Semin
that. We'll also need a way to explicitly set and clear the corresponding CS bit at a certain moment of the operation. Let's alter the set_cs function then to also de-activate the CS, when it's required. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 2 +- 1 file changed, 1 insertion

[PATCH v2 10/21] spi: dw: Perform IRQ setup in a dedicated function

2020-09-30 Thread Serge Semin
one. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 41 ++- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index 74e8f0da2883..db3fec4195f7 100644 --- a/drivers/spi/spi-dw-core.c

[PATCH v2 19/21] spi: dw: Add poll-based SPI transfers support

2020-09-30 Thread Serge Semin
t iteration. Finally the errors status is checked on each iteration. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 40 ++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index cc217b

[PATCH v2 18/21] spi: dw: Introduce max mem-ops SPI bus frequency setting

2020-09-30 Thread Serge Semin
applicable for the memory operations, since the standard SPI core interface is implemented with an assumption that there is no problem with the automatic CS toggling. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 +++- drivers/spi/spi-dw.h | 1 + 2 files changed, 4 insertions(+), 1

[PATCH v2 16/21] spi: dw: Add generic DW SSI status-check method

2020-09-30 Thread Serge Semin
of the new method to detect the errors in the IRQ- and DMA-based SPI transfer execution procedures. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 43 +++ drivers/spi/spi-dw-dma.c | 11 ++ drivers/spi/spi-dw.h | 1 + 3 files changed, 37

[PATCH v2 03/21] spi: dw: Detach SPI device specific CR0 config method

2020-09-30 Thread Serge Semin
of setting it up. By doing so we'll finally make the SPI device chip_data serving as it's supposed to - to preserve the SPI device specific DW SPI configuration. See spi-fsl-dspi.c, spi-pl022.c, spi-pxa2xx.c drivers for example of the way the chip data is utilized. Signed-off-by: Serge Semin

<    1   2   3   4   5   6   7   8   9   10   >