[PATCH] lib/scatterlist: Avoid a double memset

2020-09-20 Thread Christophe JAILLET
'sgl' is zeroed a few lines below in 'sg_init_table()'. There is no need to clear it twice. Remove the redundant initialization. Signed-off-by: Christophe JAILLET --- lib/scatterlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/scatterlist.c b/lib/scatterlist.c inde

ERROR: modpost: "rcu_idle_enter" undefined!

2020-09-20 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 325d0eab4f31c6240b59d5b2b8042c88f59405b5 commit: 1fecfdbb7acc6624655450a609221c89b5197a06 ACPI: processor: Take over RCU-idle for C3-BM idle date: 4 days ago config: ia64-defconfig (attached as .config) co

Re: [PATCH] lib/scatterlist: Avoid a double memset

2020-09-20 Thread Joe Perches
On Sun, 2020-09-20 at 09:15 +0200, Christophe JAILLET wrote: > 'sgl' is zeroed a few lines below in 'sg_init_table()'. There is no need to > clear it twice. > > Remove the redundant initialization. I didn't look very thoroughly, but there are at least a few more of these with kcalloc and kzalloc

Scammed Victim

2020-09-20 Thread Ms.Helen Clark
SCAMMED VICTIM REF CODE: 06654 This is to bring to your notice that I am a delegate from the United Nations to The IMF (International Monetary Fund) United States Regional Payment Office to pay 20 scam victims $1,000,000.00 USD (One Million Dollars only) each. You are listed and approved for this

[PATCH] scsi: pmcraid: Fix memory allocation in 'pmcraid_alloc_sglist()'

2020-09-20 Thread Christophe JAILLET
When the scatter list is allocated in 'pmcraid_alloc_sglist()', the corresponding pointer should be stored in 'scatterlist' within the 'pmcraid_sglist' structure. Otherwise, 'scatterlist' is NULL. This leads to a potential memory leak and NULL pointer dereference. Fixes: ed4414cef2ad ("scsi: pmcr

[tip:x86/cpu] BUILD SUCCESS e1ebb2b49048c4767cfa0d8466f9c701e549fa5e

2020-09-20 Thread kernel test robot
i386defconfig x86_64 randconfig-a005-20200920 x86_64 randconfig-a003-20200920 x86_64 randconfig-a004-20200920 x86_64 randconfig-a002-20200920 x86_64 randconfig-a006-20200920 x86_64 randconfig-a001-20200920

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-20 Thread Daniel Vetter
On Sun, Sep 20, 2020 at 08:23:26AM +0200, Thomas Gleixner wrote: > On Sat, Sep 19 2020 at 12:37, Daniel Vetter wrote: > > On Sat, Sep 19, 2020 at 12:35 PM Daniel Vetter wrote: > >> I think it should be the case, but I want to double check: Will > >> copy_*_user be allowed within a kmap_temporary s

Re: [PATCH] drm/bridge: dw-mipi-dsi: Use kmemdup cf. kmalloc+memcpy

2020-09-20 Thread Daniel Vetter
On Sat, Sep 19, 2020 at 9:31 PM Alex Dewar wrote: > > On 2020-09-11 13:57, Neil Armstrong wrote: > > On 09/09/2020 21:02, Alex Dewar wrote: > >> kmemdup can be used instead of kmalloc+memcpy. Replace an occurrence of > >> this pattern. > Friendly ping? > >> > >> Issue identified with Coccinelle. >

[PATCH 4.19] dmaengine: at_hdmac: Fix memory leak

2020-09-20 Thread Pavel Machek
This fixes memory leak in at_hdmac. Mainline does not have the same problem. Signed-off-by: Pavel Machek (CIP) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 86427f6ba78c..0847b2055857 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1714,8 +1714,10 @@ st

RE: [PATCH] [v2] nvme: use correct upper limit for tag in nvme_handle_cqe()

2020-09-20 Thread Tianxianting
Hi, I test and get the init flow of nvme admin queue and io queue in kernel 5.6, Currently, the code use nvmeq->q_depth as the upper limit for tag in nvme_handle_cqe(), according to below init flow, we already have the race currently. Admin queue init flow: 1, set nvmeq->q_depth 32 for admin que

Re: [PATCH] x86/boot: Delay BSP init until after FPU initialization

2020-09-20 Thread Borislav Petkov
On Sun, Sep 20, 2020 at 10:03:10AM +0900, Mike Hommey wrote: > FPU initialization handles the clearcpuid command line argument. If it > comes after BSP init, clearcpuid cannot be used to disable features that > trigger some parts of the BSP init code. > > Signed-off-by: Mike Hommey > --- > arch/

[PATCH] watchdog: fix memory leak in error path

2020-09-20 Thread Pavel Machek
Fix memory leak in error path. Signed-off-by: Pavel Machek (CIP) diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index 6798addabd5a..785270ee337c 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c @@ -994,8 +994,10 @@ static int watc

Re: [PATCH] lib/scatterlist: Avoid a double memset

2020-09-20 Thread Julia Lawall
On Sun, 20 Sep 2020, Joe Perches wrote: > On Sun, 2020-09-20 at 09:15 +0200, Christophe JAILLET wrote: > > 'sgl' is zeroed a few lines below in 'sg_init_table()'. There is no need to > > clear it twice. > > > > Remove the redundant initialization. > > I didn't look very thoroughly, but there ar

[PATCH] usb: yurex: Rearrange code not to need GFP_ATOMIC

2020-09-20 Thread Pavel Machek
Move prepare to wait around, so that normal GFP_KERNEL allocation can be used. Signed-off-by: Pavel Machek (CIP) Acked-by: Alan Stern diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index b2e09883c7e2..071f1debebba 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/y

Re: [PATCH v3 00/14] Adding GAUDI NIC code to habanalabs driver

2020-09-20 Thread Greg Kroah-Hartman
On Sat, Sep 19, 2020 at 04:22:35PM -0300, Jason Gunthorpe wrote: > On Sat, Sep 19, 2020 at 07:27:30PM +0200, Greg Kroah-Hartman wrote: > > > It's probably heresy, but why do I need to integrate into the RDMA > > > subsystem ? > > > I understand your reasoning about networking (Ethernet) as the dri

Re: [patch RFC 00/15] mm/highmem: Provide a preemptible variant of kmap_atomic & friends

2020-09-20 Thread Thomas Gleixner
On Sun, Sep 20 2020 at 08:41, Thomas Gleixner wrote: > On Sat, Sep 19 2020 at 10:18, Linus Torvalds wrote: >> Maybe I've missed something. Is it because the new interface still >> does "pagefault_disable()" perhaps? >> >> But does it even need the pagefault_disable() at all? Yes, the >> *atomic* o

Re: [PATCH] lib/scatterlist: Avoid a double memset

2020-09-20 Thread Christophe JAILLET
Le 20/09/2020 à 10:32, Julia Lawall a écrit : On Sun, 20 Sep 2020, Joe Perches wrote: On Sun, 2020-09-20 at 09:15 +0200, Christophe JAILLET wrote: 'sgl' is zeroed a few lines below in 'sg_init_table()'. There is no need to clear it twice. Remove the redundant initialization. I didn't look

[PATCH] media: firewire: fix memory leak

2020-09-20 Thread Pavel Machek
Fix memory leak in node_probe. Signed-off-by: Pavel Machek (CIP) diff --git a/drivers/media/firewire/firedtv-fw.c b/drivers/media/firewire/firedtv-fw.c index 3f1ca40b9b98..8a8585261bb8 100644 --- a/drivers/media/firewire/firedtv-fw.c +++ b/drivers/media/firewire/firedtv-fw.c @@ -272,8 +272

[PATCH] 6lowpan: Add missing locking

2020-09-20 Thread Pavel Machek
I believe set_lock should be taken in exit function, too. Signed-off-by: Pavel Machek (CIP) diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index cff4944d5b66..1420734394e9 100644 --- a/net/bluetooth/6lowpan.c +++ b/net/bluetooth/6lowpan.c @@ -1301,10 +1301,12 @@ static void __ex

[PATCH 1/4] blk-throttle: Remove a meaningless parameter for throtl_downgrade_state()

2020-09-20 Thread Baolin Wang
The throtl_downgrade_state() is always used to change to LIMIT_LOW limitation, thus remove the latter meaningless parameter which indicates the limitation index. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/bl

[PATCH 0/4] Some improvements for blk throttle

2020-09-20 Thread Baolin Wang
Hi, This patch set did some improvements for blk throttle, please help to review. Thanks. Baolin Wang (4): blk-throttle: Remove a meaningless parameter for throtl_downgrade_state() blk-throttle: Avoid getting the current time if tg->last_finish_time is 0 blk-throttle: Avoid tracking

[PATCH 2/4] blk-throttle: Avoid getting the current time if tg->last_finish_time is 0

2020-09-20 Thread Baolin Wang
We only update the tg->last_finish_time when the low limitaion is enabled, so we can move the tg->last_finish_time validation a little forward to avoid getting the unnecessary current time stamp if the the low limitation is not enabled. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 8 +++

[PATCH 3/4] blk-throttle: Avoid tracking latency if low limit is invalid

2020-09-20 Thread Baolin Wang
The IO latency tracking is only for LOW limit, so we should add a validation to avoid redundant latency tracking if the LOW limit is not valid. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/blk-throttle.c b/block/

[PATCH 4/4] blk-throttle: Fix IO hang for a corner case

2020-09-20 Thread Baolin Wang
It can not scale up in throtl_adjusted_limit() if we set bps or iops is 1, which will cause IO hang when enable low limit. Thus we should treat 1 as a illegal value to avoid this issue. Signed-off-by: Baolin Wang --- block/blk-throttle.c | 8 1 file changed, 4 insertions(+), 4 deletions

[PATCH v2] checkpatch: extend author Signed-off-by check for split From: header

2020-09-20 Thread Dwaipayan Ray
Checkpatch did not handle cases where the author From: header was split into multiple lines. The author identity could not be resolved and checkpatch generated a false NO_AUTHOR_SIGN_OFF warning. A typical example is Commit e33bcbab16d1 ("tee: add support for session's client UUID generation"). Wh

KMSAN: uninit-value in is_idle_task

2020-09-20 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:3b3ea602 x86: add failure injection to get/put/clear_user git tree: https://github.com/google/kmsan.git master console output: https://syzkaller.appspot.com/x/log.txt?x=144b896590 kernel config: https://syzkaller.appspot.com/x

kernel BUG at fs/f2fs/segment.h:LINE!

2020-09-20 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:fc4f28bb Merge tag 'for-5.9-rc5-tag' of git://git.kernel.o.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=134d97dd90 kernel config: https://syzkaller.appspot.com/x/.config?x=c61f6bd349c981f3 das

[GIT PULL] EDAC urgent for v5.9-rc6

2020-09-20 Thread Borislav Petkov
Hi Linus, please pull two more fixes for ghes_edac resulting from playing with CONFIG_DEBUG_TEST_DRIVER_REMOVE=y. Thx. --- The following changes since commit 856deb866d16e29bd65952e0289066f6078af773: Linux 5.9-rc5 (2020-09-13 16:06:00 -0700) are available in the Git repository at: git://g

RE: R: [PATCH v2 4/4] dt-bindings: net: Document use of mac-address-increment

2020-09-20 Thread ansuelsmth
> On Sun, Sep 20, 2020 at 02:39:39AM +0200, ansuels...@gmail.com > wrote: > > > > > > > -Messaggio originale- > > > Da: Andrew Lunn > > > Inviato: domenica 20 settembre 2020 02:31 > > > A: Ansuel Smith > > > Cc: Miquel Raynal ; Richard Weinberger > > > ; Vignesh Raghavendra ; Rob > Herrin

[PATCH v3 1/4] mtd: Add nvmem support for mtd nvmem-providers

2020-09-20 Thread Ansuel Smith
Introduce 2 new bindings for the mtd structure. Mtd partitions can be set as 'nvmem-provider' and any subpartition defined with the tag 'nvmem-cell' are skipped by the 'fixed-partitions' parser and registred as a nvmem cell by the nvmem api. Signed-off-by: Ansuel Smith --- drivers/mtd/mtdcore.c

[PATCH v3 2/4] dt-bindings: mtd: partition: Document use of nvmem-provider

2020-09-20 Thread Ansuel Smith
Document the use of this 2 new bindings, nvmem-provider and nvmem-cell, used to describe the nvmem cell that the subpartition provide to the nvmem api and the system. Nvmem cell are direct subnode of the subpartition and are skipped by the 'fixed-partitions' parser if they contain the 'nvmem-cell'

[PATCH v3 0/4] Actually implement nvmem support for mtd

2020-09-20 Thread Ansuel Smith
The mtd support for the nvmem api has been stalled from 2018 with a patch half pushed hoping that a scheme is found for the mtd name later. This pathset try to address this and add a very needed feature for the mac-address. My solution to the already discussed problem here [1] is to keep it simple

[PATCH v3 3/4] of_net: add mac-address-increment support

2020-09-20 Thread Ansuel Smith
Lots of embedded devices use the mac-address of other interface extracted from nvmem cells and increments it by one or two. Add two bindings to integrate this and directly use the right mac-address for the interface. Some example are some routers that use the gmac mac-address stored in the art part

[PATCH v3 4/4] dt-bindings: net: Document use of mac-address-increment

2020-09-20 Thread Ansuel Smith
Two new bindings are now supported by the of_net driver to increase (or decrease) a mac-address. This can be very useful in case where the system extract the mac-address for the device from a dedicated partition and have a generic mac-address that needs to be incremented based on the device number.

Re: [RFC PATCH 21/24] mm/hugetlb: Merge pte to huge pmd only for gigantic page

2020-09-20 Thread Muchun Song
On Tue, Sep 15, 2020 at 9:03 PM Muchun Song wrote: > > Merge pte to huge pmd if it has ever been split. Now only support > gigantic page which's vmemmap pages size is an integer multiple of > PMD_SIZE. This is the simplest case to handle. > > Signed-off-by: Muchun Song > --- > include/linux/huge

Re: [PATCH] PR_SPEC_DISABLE_NOEXEC support for arm64.

2020-09-20 Thread Anthony Steinhauser
> As a heads up: I'm currently reworking most of this, and hope to post > something within the next two weeks. Sure. Let me know whether you want to implement the PR_SPEC_DISABLE_NOEXEC support directly or whether this patch would be relevant even after your rework. > > > diff --git a/arch/arm64/i

Re: [PATCH v8 04/20] gpio: uapi: define uAPI v2

2020-09-20 Thread Kent Gibson
On Tue, Sep 15, 2020 at 01:06:36PM +0300, Andy Shevchenko wrote: > On Wed, Sep 9, 2020 at 1:29 PM Kent Gibson wrote: > > > > Thanks again for doing this and sorry for quite a delay from my side. > Below my comments regarding uAPI v2 (mostly nit-picks as I agree with > it in general). > No probl

possible deadlock in xfrm_policy_lookup_bytype

2020-09-20 Thread syzbot
Hello, syzbot found the following issue on: HEAD commit:5fa35f24 Add linux-next specific files for 20200916 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=16ec67fd90 kernel config: https://syzkaller.appspot.com/x/.config?x=6bdb7e39caf48f53 dashboard

[PATCH 1/2] mips: Add strong UC ordering config

2020-09-20 Thread Serge Semin
In accordance with [1, 2] memory transactions using CCA=2 (Uncached Cacheability and Coherency Attribute) are always strongly ordered. This means the younger memory accesses using CCA=2 are never allowed to be executed before older memory accesses using CCA=2 (no bypassing is allowed), and Loads an

[PATCH 2/2] mips: Introduce MIPS CM2 GCR Control register accessors

2020-09-20 Thread Serge Semin
For some reason these accessors have been absent from the MIPS kernel, while some of them can be used to tune the MIPS code execution up (the default value are fully acceptable though). For instance, in the framework of MIPS P5600/P6600 (see [1] for details) if we are sure the IO interconnect doesn

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

2020-09-20 Thread Serge Semin
It has been discovered that on our MIPS P5600-based CPU the IO accessors aren't that rapid as they could be even taking into account a relatively slow AXI2APB bridge embedded into the system interconnect. Turned out we can introduce two types of optimizations. First we can remove the execution barr

[PATCH 1/3] hwmon: bt1-pvt: Test sensor power supply on probe

2020-09-20 Thread Serge Semin
Baikal-T1 PVT sensor has got a dedicated power supply domain (feed up by the external GPVT/VPVT_18 pins). In case if it isn't powered up, the registers will be accessible, but the sensor conversion just won't happen. Due to that an attempt to read data from any PVT sensor will cause the task hangin

[PATCH 0/3] hwmon: bt1-pvt: Fix PVT sensor being unpowered

2020-09-20 Thread Serge Semin
Baikal-T1 PVT sensor has got a dedicated power domain with 1.8V intended to be supplied via the external GPVT and VPVT_18 pins. In case if the power isn't supplied, the sensor IO registers will be accessible, but the data conversion just won't happen. The situation of the power loss currently will

[PATCH 3/3] hwmon: bt1-pvt: Wait for the completion with timeout

2020-09-20 Thread Serge Semin
If the PVT sensor is suddenly powered down while a caller is waiting for the conversion completion, the request won't be finished and the task will hang up on this procedure until the power is back up again. Let's call the wait_for_completion_timeout() method instead to prevent that. The cached tim

[PATCH 2/3] hwmon: bt1-pvt: Cache current update timeout

2020-09-20 Thread Serge Semin
Instead of converting the update timeout data to the milliseconds each time on the read procedure let's preserve the currently set timeout in the dedicated driver private data cache. The cached value will be then used in the timeout read method and in the alarm-less data conversion to prevent the c

[rcu:dev.2020.09.17b] BUILD SUCCESS ef749b8a4cc43dcbdf6e5848acdc2cb8d6950b45

2020-09-20 Thread kernel test robot
defconfig mips allyesconfig mips allmodconfig powerpc allyesconfig powerpc allmodconfig x86_64 randconfig-a005-20200920 x86_64 randconfig-a003-20200920 x86_64

Re: [PATCH v7 07/20] gpiolib: cdev: support GPIO_V2_GET_LINE_IOCTL and GPIO_V2_LINE_GET_VALUES_IOCTL

2020-09-20 Thread Kent Gibson
On Tue, Sep 15, 2020 at 01:31:27PM +0300, Andy Shevchenko wrote: > On Sat, Sep 5, 2020 at 4:49 PM Kent Gibson wrote: > > > > Add support for requesting lines using the GPIO_V2_GET_LINE_IOCTL, and > > returning their current values using GPIO_V2_LINE_GET_VALUES_IOCTL. > > > > The struct linereq imp

[PATCH] clk: baikal-t1: Mark Ethernet PLL as critical

2020-09-20 Thread Serge Semin
We've discovered that disabling the so called Ethernet PLL causes reset of the devices consuming its outgoing clock. The resets happen automatically even if each underlying clock gate is turned off. Due to that we can't disable the Ethernet PLL until the kernel is prepared for the corresponding res

[PATCH v3] mtd: physmap: Add Baikal-T1 physically mapped ROM support

2020-09-20 Thread Serge Semin
Baikal-T1 Boot Controller provides an access to a RO storages, which are physically mapped into the SoC MMIO space. In particularly there are Internal ROM embedded into the SoC with a pre-installed firmware, externally attached SPI flash (also accessed in the read-only mode) and a memory region, wh

[PATCH v2 11/11] spi: dw-dma: Add one-by-one SG list entries transfer

2020-09-20 Thread Serge Semin
In case if at least one of the requested DMA engine channels doesn't support the hardware accelerated SG list entries traverse, the DMA driver will most likely work that around by performing the IRQ-based SG list entries resubmission. That might and will cause a problem if the DMA Tx channel is rec

[PATCH v2 04/11] spi: dw-dma: Check rx_buf availability in the xfer method

2020-09-20 Thread Serge Semin
Checking rx_buf for being NULL and returning NULL from the Rx-channel preparation method doesn't let us to distinguish that situation from errors happening during the Rx SG-list preparation. So it's better to make sure that the rx_buf not-NULL and full-duplex communication is requested prior callin

[PATCH v2 03/11] spi: dw-dma: Configure the DMA channels in dma_setup

2020-09-20 Thread Serge Semin
Mainly this is a preparation patch before adding one-by-one DMA SG entries transmission. But logically the Tx and Rx DMA channels setup should be performed in the dma_setup() callback anyway. So we'll move the DMA slave channels src/dst burst lengths, address and address width configuration from th

Re: [PATCH v8 09/20] gpiolib: cdev: support edge detection for uAPI v2

2020-09-20 Thread Kent Gibson
On Tue, Sep 15, 2020 at 01:39:41PM +0300, Andy Shevchenko wrote: > On Wed, Sep 9, 2020 at 1:33 PM Kent Gibson wrote: > > > > Add support for edge detection to lines requested using > > GPIO_V2_GET_LINE_IOCTL. > > > > The edge_detector implementation is based on the v1 lineevent > > implementation.

[PATCH v2 02/11] spi: dw-dma: Fail DMA-based transfer if no Tx-buffer specified

2020-09-20 Thread Serge Semin
Since commit 46164fde6b78 ("spi: dw: Fix Rx-only DMA transfers") if DMA interface is enabled, then Tx-buffer must be available in each SPI transfer. It's required since in order to activate the incoming data reception either DMA or CPU must be pushing data out to the SPI bus. But the DW APB SSI DMA

[PATCH v2 10/11] spi: dw-dma: Pass exact data to the DMA submit and wait methods

2020-09-20 Thread Serge Semin
In order to use the DMA submission and waiting methods in both generic DMA-based SPI transfer and one-by-one DMA SG entries transmission functions, we need to modify the dw_spi_dma_wait() and dw_spi_dma_submit_tx()/dw_spi_dma_submit_rx() prototypes. So instead of getting the SPI transfer object as

Re: [PATCH v2 1/3] MAINTAINERS: Add Fabrizio Castro to Renesas DRIF

2020-09-20 Thread Ramesh Shanmugasundaram
Hi Fabrizio, > > Renesas are expanding their DRIF support and offering, > I'll be the internal maintainer for DRIF. > > Signed-off-by: Fabrizio Castro > Reviewed-by: Laurent Pinchart Thank you for volunteering :-). Reviewed-by: Ramesh Shanmugasundaram Please feel free to take my name off the

[PATCH v2 00/11] spi: dw-dma: Add max SG entries burst capability support

2020-09-20 Thread Serge Semin
Mainly this series is about fixing a very nasty problem discovered in the DW APB SSI driver working in a couple with DW DMAC, which doesn't have multi-block capability support (a.k.a. accelerated SG list entries traversal/burst, or automatic LLP entries reload, etc.). DW DMA IP-core and its DMA ch

[PATCH v2 05/11] spi: dw-dma: Move DMA transfers submission to the channels prep methods

2020-09-20 Thread Serge Semin
Indeed we can freely move the dmaengine_submit() method invocation and the Tx and Rx busy flag setting into the DMA Tx/Rx prepare methods. Since the Tx/Rx preparation method is now mainly used for the DMA transfers submission, here we suggest to rename it to have the _submit_{r,t}x suffix instead.

[PATCH v2 01/11] spi: dw-dma: Set DMA Level registers on init

2020-09-20 Thread Serge Semin
Indeed the registers content doesn't get cleared when the SPI controller is disabled and enabled. Max burst lengths aren't changed since the Rx and Tx DMA channels are requested on init stage and are kept acquired until the device is removed. Obviously SPI controller FIFO depth can't be changed. Du

[PATCH v2 07/11] spi: dw-dma: Remove DMA Tx-desc passing around

2020-09-20 Thread Serge Semin
It's pointless to pass the Rx and Tx transfers DMA Tx-descriptors, since they are used in the Tx/Rx submit method only. Instead just return the submission status from these methods. This alteration will make the code less complex. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-dma.c | 31

[PATCH v2 06/11] spi: dw-dma: Check DMA Tx-desc submission status

2020-09-20 Thread Serge Semin
We suggest to add the dmaengine_submit() return value test for errors. It has been unnecessary while the driver was expected to be utilized in pair with DW DMAC. But since now the driver can be used with any DMA engine, it might be useful to track the errors on DMA submissions so not miss them and

[PATCH v2 08/11] spi: dw-dma: Detach DMA transfer into a dedicated method

2020-09-20 Thread Serge Semin
In order to add an alternative method of DMA-based SPI transfer first we need to detach the currently available one from the common code. Here we move the normal DMA-based SPI transfer execution functionality into a dedicated method. It will be utilized if either the DMA engine supports an unlimite

[PATCH v2 09/11] spi: dw-dma: Move DMAC register cleanup to DMA transfer method

2020-09-20 Thread Serge Semin
DW APB SSI DMA driver doesn't use the native SPI core wait API since commit bdbdf0f06337 ("spi: dw: Locally wait for the DMA transfers completion"). Due to that the driver can now clear the DMAC register in a single place synchronously with the DMA transactions completion or failure. After that all

[PATCH 01/30] spi: dw: Discard IRQ threshold macro

2020-09-20 Thread Serge Semin
The macro has been unused since a half of FIFO length was defined to be a marker of the IRQ. Let's remove it definition. Signed-off-by: Serge Semin --- drivers/spi/spi-dw.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h index 90dfd21622d6..51bab

[PATCH 12/30] spi: dw: Detach SPI device specific CR0 config method

2020-09-20 Thread Serge Semin
Indeed there is no point in detecting the SPI peripheral device parameters and initializing the CR0 register fields each time an SPI transfer is executed. Instead let's define a dedicated CR0 chip-data member, which will be initialized in accordance with the SPI device settings at the moment of set

[PATCH 07/30] spi: dw: Use relaxed IO-methods to access FIFOs

2020-09-20 Thread Serge Semin
In accordance with [1] the relaxed methods are guaranteed to be ordered with respect to other accesses from the same CPU thread to the same peripheral. This is what we need during the data read/write from/to the controller FIFOs being executed within a single IRQ handler or a kernel task. Such op

[PATCH 10/30] spi: dw: Add KeemBay Master capability

2020-09-20 Thread Serge Semin
In a further commit we'll have to get rid of the update_cr0() callback and define a DW SSI capability instead. Since Keem Bay master/slave functionality is controller by the CTRL0 register bitfield, we need to first move the master mode selection into the internal corresponding update_cr0 method, w

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

2020-09-20 Thread Serge Semin
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 memory barrier. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/

[PATCH 09/30] spi: dw: Convert CS-override to DW SPI capabilities

2020-09-20 Thread Serge Semin
There are several vendor-specific versions of the DW SPI controllers, each of which may have some peculiarities with respect to the original IP-core. Seeing it has already caused adding flags and a callback into the DW SPI private data, let's introduce a generic capabilities interface to tune the g

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

2020-09-20 Thread Serge Semin
Originally I intended to merge a dedicated Baikal-T1 System Boot SPI Controller driver into the kernel and leave the DW APB SSI driver untouched. But after a long discussion (see the link at the bottom of the letter) Mark and Andy persuaded me to integrate what we developed there into the DW APB SS

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

2020-09-20 Thread Serge Semin
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 version of one is specified. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --gi

[PATCH 14/30] spi: dw: Simplify the SPI bus speed config procedure

2020-09-20 Thread Serge Semin
The code currently responsible for the SPI communication speed setting up is a bit messy. Most likely for some historical reason the bus frequency is saved in the peripheral chip private data. It's pointless now since the custom communication speed is a SPI-transfer-specific thing and only if there

[PATCH 08/30] spi: dw: Discard DW SSI chip type storages

2020-09-20 Thread Serge Semin
Keeping SPI peripheral devices type is pointless since first it hasn't been functionally utilized by any of the client drivers/code and second it won't work for Microwire type at the very least. Moreover there is no point in setting up the type by means of the chip-data in the modern kernel. The pe

[PATCH 16/30] spi: dw: Add DW SPI controller config structure

2020-09-20 Thread Serge Semin
DW APB SSI controller can be used by the two SPI core interfaces: traditional SPI transfers and SPI memory operations. The controller needs to be accordingly configured at runtime when the corresponding operations are executed. In order to do that for the both interfaces from a single function we i

[PATCH 27/30] spi: dw: Introduce max mem-ops SPI bus frequency setting

2020-09-20 Thread Serge Semin
In some circumstances the current implementation of the SPI memory operations may occasionally fail even though they are executed in the atomic context. This may happen if the system bus is relatively slow in comparison to the SPI bus frequency, or there is a concurrent access to it, which makes th

[PATCH 18/30] spi: dw: Refactor IRQ-based SPI transfer procedure

2020-09-20 Thread Serge Semin
Current IRQ-based SPI transfer execution procedure doesn't work well at the final stage of the execution. If all the Tx data is sent out (written to the Tx FIFO) but there is some data left to receive, the Tx FIFO Empty IRQ will constantly happen until all of the requested inbound data is received.

[PATCH 19/30] spi: dw: Perform IRQ setup in a dedicated function

2020-09-20 Thread Serge Semin
In order to make the transfer_one() callback method more readable and for unification with the DMA-based transfer, let's detach the IRQ setup procedure into a dedicated function. While at it rename the IRQ-based transfer handler function to be dw_spi-prefixe and looking more like the DMA-related on

[PATCH 05/30] spi: dw: Clear IRQ status on DW SPI controller reset

2020-09-20 Thread Serge Semin
It turns out the IRQ status isn't cleared after switching the controller off and getting it back on, which may cause raising false error interrupts if controller has been unsuccessfully used by, for instance, a bootloader before the driver is loaded. Let's explicitly clear the interrupts status in

[PATCH 17/30] spi: dw: Refactor data IO procedure

2020-09-20 Thread Serge Semin
The Tx and Rx data write/read procedure can be significantly simplified by using Tx/Rx transfer lengths instead of the end pointers. By having the Tx/Rx data leftover lengths (in the number of transfer words) we can get rid of all subtraction and division operations utilized here and there in the t

[PATCH 22/30] spi: dw: De-assert chip-select on reset

2020-09-20 Thread Serge Semin
SPI memory operations implementation will require to have the CS register cleared before executing the operation in order not to have the transmission automatically started prior the Tx FIFO is pre-initialized. Let's clear the register then on explicit controller reset to fulfil the requirements in

[PATCH 29/30] dt-bindings: spi: dw: Add Baikal-T1 SPI Controllers

2020-09-20 Thread Serge Semin
These controllers are based on the DW APB SSI IP-core and embedded into the SoC, so two of them are equipped with IRQ, DMA, 64 words FIFOs and 4 native CS, while another one as being utilized by the Baikal-T1 System Boot Controller has got a very limited resources: no IRQ, no DMA, only a single nat

[PATCH 13/30] spi: dw: Update SPI bus speed in a config function

2020-09-20 Thread Serge Semin
The SPI bus speed update functionality will be useful in another parts of the driver too (like to implement the SPI memory operations and from the DW SPI glue layers). Let's move it to the update_cr0() method then and since the later is now updating not only the CTRLR0 register alter its prototype

[PATCH 26/30] spi: dw: Add memory operations support

2020-09-20 Thread Serge Semin
Aside from the synchronous Tx-Rx mode, which has been utilized to create the normal SPI transfers in the framework of the DW SSI driver, DW SPI controller supports Tx-only and EEPROM-read modes. The former one just enables the controller to transmit all the data from the Tx FIFO ignoring anything r

[PATCH 24/30] spi: dw: Move num-of retries parameter to the header file

2020-09-20 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 23/30] spi: dw: Explicitly de-assert CS on SPI transfer completion

2020-09-20 Thread Serge Semin
By design of the currently available native set_cs callback, the CS de-assertion will be done only if it's required by the corresponding controller capability. But in order to pre-fill the Tx FIFO buffer with data during the SPI memory ops execution the SER register needs to be left cleared before

[PATCH 28/30] spi: dw: Add poll-based SPI transfers support

2020-09-20 Thread Serge Semin
A functionality of the poll-based transfer has been removed by commit 1ceb09717e98 ("spi: dw: remove cs_control and poll_mode members from chip_data") with a justification that "there is no user of one anymore". It turns out one of our DW APB SSI core is synthesized with no IRQ line attached and th

[PATCH 20/30] spi: dw: Unmask IRQs after enabling the chip

2020-09-20 Thread Serge Semin
It's theoretically erroneous to enable IRQ before the chip is turned on. If IRQ handler gets executed before the chip is enabled, then any data written to the Tx FIFO will be just ignored. I say "theoretically" because we haven't noticed any problem with that, but let's fix it anyway just in case.

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

2020-09-20 Thread Serge Semin
There is no point in having the commit 19b61392c5a8 ("spi: spi-dw: Add lock protect dw_spi rx/tx to prevent concurrent calls") applied. The commit author made an assumption that the problem with the rx data mismatch was due to the lack of the data protection. While most likely it was caused by the

[PATCH 06/30] spi: dw: Disable all IRQs when controller is unused

2020-09-20 Thread Serge Semin
It's a good practice to disable all IRQs if a device is fully unused. In our case it is supposed to be done before requesting the IRQ and after the last byte of an SPI transfer is received. In the former case it's required to prevent the IRQ handler invocation before the driver data is fully initia

[PATCH 25/30] spi: dw: Add generic DW SSI status-check method

2020-09-20 Thread Serge Semin
The DW SSI errors handling method can be generically implemented for all types of the transfers: IRQ, DMA and poll-based ones. It will be a function which checks the overflow/underflow error flags and resets the controller if any of them is set. In the framework of this commit we make use of the ne

[PATCH 15/30] spi: dw: Update Rx sample delay in the config function

2020-09-20 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 21/30] spi: dw: Discard chip enabling on DMA setup error

2020-09-20 Thread Serge Semin
It's pointless to enable the chip back if the DMA setup procedure fails, since we'll disable it on the next transfer anyway. For the same reason We don't do that in case of a failure detected in any other methods called from the transfer_one() method. While at it consider any non-zero value return

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

2020-09-20 Thread Serge Semin
Currently DWC SSI core is supported by means of setting up the core-specific update_cr0() callback. It isn't suitable for multiple reasons. First of all having exported several methods doing the same thing but for different chips makes the code harder to maintain. Secondly the spi-dw-core driver ex

[PATCH 1/2] lib: devres: provide devm_iounremap_resource()

2020-09-20 Thread pierre Kuo
Driver doesn't have a single helper function to release memroy allocated by devm_ioremap_resource(). That mean it needs respectively to call devm_release_mem_region() and devm_iounmap() for memory release. This patch creates a helper, devm_iounremap_resource(), to combine above operations. Signed

[PATCH 2/2] driver core: platform: provide devm_platform_iounremap_resource

2020-09-20 Thread pierre Kuo
Combine platform_get_resource() and devm_iounremap_resource() to release the iomem allocated by devm_platform_get_and_ioremap_resource(). Signed-off-by: pierre Kuo --- drivers/base/platform.c | 24 include/linux/platform_device.h | 4 2 files changed, 28 in

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

2020-09-20 Thread Serge Semin
Baikal-T1 is equipped with three DW APB SSI-based MMIO SPI controllers. Two of them are pretty much normal: with IRQ, DMA, FIFOs of 64 words depth, 4x CSs, but the third one as being a part of the Baikal-T1 System Boot Controller has got a very limited resources: no IRQ, no DMA, only a single nativ

outside repository fatal error

2020-09-20 Thread Julia Lawall
The commit bcf4271d4bc3 ("checkpatch: allow not using -f with files that are in git") in linux-next seems to cause checkpatch to fail on a file containing a patch if that file is not in the directory containing the Linux kernel. Is that intentional? thanks, julia

[PATCH 13/14] misc: mic: drop double zeroing

2020-09-20 Thread Julia Lawall
sg_init_table zeroes its first argument, so the allocation of that argument doesn't have to. the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x,n,flags; @@ x = - kcalloc + kmalloc_array (n,sizeof(struct scatterlist),flags) ... sg_init_tab

[PATCH 08/14] xprtrdma: drop double zeroing

2020-09-20 Thread Julia Lawall
sg_init_table zeroes its first argument, so the allocation of that argument doesn't have to. the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x,n,flags; @@ x = - kcalloc + kmalloc_array (n,sizeof(*x),flags) ... sg_init_table(x,n) // Sig

[PATCH 06/14] block: drop double zeroing

2020-09-20 Thread Julia Lawall
sg_init_table zeroes its first argument, so the allocation of that argument doesn't have to. the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ x = - kzalloc + kmalloc (...) ... sg_init_table(x,...) // Signed-off-by: Julia Lawall --

  1   2   3   4   5   >