platform/kernel/linux-rpi.git
4 years agostaging: tegra-vde: fix common struct sg_table related issues
Marek Szyprowski [Fri, 4 Sep 2020 13:17:07 +0000 (15:17 +0200)]
staging: tegra-vde: fix common struct sg_table related issues

The Documentation/DMA-API-HOWTO.txt states that the dma_map_sg() function
returns the number of the created entries in the DMA address space.
However the subsequent calls to the dma_sync_sg_for_{device,cpu}() and
dma_unmap_sg must be called with the original number of the entries
passed to the dma_map_sg().

struct sg_table is a common structure used for describing a non-contiguous
memory buffer, used commonly in the DRM and graphics subsystems. It
consists of a scatterlist with memory pages and DMA addresses (sgl entry),
as well as the number of scatterlist entries: CPU pages (orig_nents entry)
and DMA mapped pages (nents entry).

It turned out that it was a common mistake to misuse nents and orig_nents
entries, calling DMA-mapping functions with a wrong number of entries or
ignoring the number of mapped entries returned by the dma_map_sg()
function.

To avoid such issues, lets use a common dma-mapping wrappers operating
directly on the struct sg_table objects and use scatterlist page
iterators where possible. This, almost always, hides references to the
nents and orig_nents entries, making the code robust, easier to follow
and copy/paste safe.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20200904131711.12950-27-m.szyprowski@samsung.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: pi433: break long lines
Bryan Brattlof [Wed, 2 Sep 2020 19:22:05 +0000 (19:22 +0000)]
staging: pi433: break long lines

scripts/checkpatch.pl is warning about some lines exceeding 100
charecters. This will cleanup the warnings.

Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/87y2lsrnl8.fsf@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: os_dep: added blank line to fix coding style issue
Ross Schmidt [Wed, 2 Sep 2020 19:20:44 +0000 (14:20 -0500)]
staging: rtl8723bs: os_dep: added blank line to fix coding style issue

Fixed a coding style issue by adding a blank line after declarations in
sdio_intf.c to fix a checkpatch warning.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20200902192044.19143-1-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging/emxx_udc: Remove pointless variable assignments
Alex Dewar [Wed, 2 Sep 2020 15:46:24 +0000 (16:46 +0100)]
staging/emxx_udc: Remove pointless variable assignments

In a number of places in emxx_udc.c, there are variables which are
assigned to without that value ever being used. Remove these pointless
assignments.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 33aa8d45a4fe ("staging: emxx_udc: Add Emma Mobile USB Gadget driver")
Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Link: https://lore.kernel.org/r/20200902154628.283453-1-alex.dewar90@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: spmi: hisi-spmi-controller: Use proper format in call to dev_err()
YueHaibing [Tue, 1 Sep 2020 03:57:22 +0000 (11:57 +0800)]
staging: spmi: hisi-spmi-controller: Use proper format in call to dev_err()

The correct format string for a size_t argument should be %zu.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/20200901035722.9324-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: os_dep: return errcode in cfg80211_rtw_leave_ibss()
YueHaibing [Sat, 29 Aug 2020 12:41:14 +0000 (20:41 +0800)]
staging: rtl8723bs: os_dep: return errcode in cfg80211_rtw_leave_ibss()

We should return error to caller in cfg80211_rtw_leave_ibss().

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20200829124114.5792-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8188eu: use __func__ in os_dep
Michael Straube [Sun, 30 Aug 2020 07:21:40 +0000 (09:21 +0200)]
staging: rtl8188eu: use __func__ in os_dep

Use __func__ instead of hardcoded function names to clear
checkpatch warnings.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200830072140.14178-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: qlge: qlge_mpi: Fix several CHECKs involving braces
Sebastian Fuentes [Mon, 31 Aug 2020 01:48:59 +0000 (18:48 -0700)]
staging: qlge: qlge_mpi: Fix several CHECKs involving braces

CHECK: Blank lines aren't necessary before a close brace '}'
FILE: drivers/staging/qlge/qlge_mpi.c:121:

CHECK: Unbalanced braces around else statement
FILE: drivers/staging/qlge/qlge_mpi.c:243:

CHECK: braces {} should be used on all arms of this statement
FILE: drivers/staging/qlge/qlge_mpi.c:350:

CHECK: Unbalanced braces around else statement
FILE: drivers/staging/qlge/qlge_mpi.c:352:

CHECK: Blank lines aren't necessary before a close brace '}'
FILE: drivers/staging/qlge/qlge_mpi.c:360:

CHECK: Blank lines aren't necessary after an open brace '{'
FILE: drivers/staging/qlge/qlge_mpi.c:408:

CHECK: braces {} should be used on all arms of this statement
FILE: drivers/staging/qlge/qlge_mpi.c:997:

CHECK: Unbalanced braces around else statement
FILE: drivers/staging/qlge/qlge_mpi.c:1001:

Signed-off-by: Sebastian Fuentes <sefu1789@gmail.com>
Link: https://lore.kernel.org/r/20200831014859.GA29362@ubuntu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: emxx_udc: Fix passing of NULL to dma_alloc_coherent()
Alex Dewar [Tue, 25 Aug 2020 09:19:28 +0000 (10:19 +0100)]
staging: emxx_udc: Fix passing of NULL to dma_alloc_coherent()

In nbu2ss_eq_queue() memory is allocated with dma_alloc_coherent(),
though, strangely, NULL is passed as the struct device* argument. Pass
the UDC's device instead. Fix up the corresponding call to
dma_free_coherent() in the same way.

Build-tested on x86 only.

Fixes: 33aa8d45a4fe ("staging: emxx_udc: Add Emma Mobile USB Gadget driver")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Link: https://lore.kernel.org/r/20200825091928.55794-1-alex.dewar90@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: media: atomisp: Convert to GPIO descriptors
Linus Walleij [Thu, 27 Aug 2020 08:14:45 +0000 (10:14 +0200)]
staging: media: atomisp: Convert to GPIO descriptors

Convert the atomisp LM3554 driver to use GPIO descriptors
fully. It was already retrieveing the GPIO lines as descriptors
but for some reason converting them back into global GPIO
numbers. There is no reason to do this, just deal with the
descriptors as-is.

Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20200827081445.186882-1-linus.walleij@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wilc1000: Fix memleak in wilc_bus_probe
Dinghao Liu [Wed, 19 Aug 2020 11:54:26 +0000 (19:54 +0800)]
staging: wilc1000: Fix memleak in wilc_bus_probe

When devm_clk_get() returns -EPROBE_DEFER, spi_priv
should be freed just like when wilc_cfg80211_init()
fails.

Fixes: 854d66df74aed ("staging: wilc1000: look for rtc_clk clock in spi mode")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20200819115426.29852-1-dinghao.liu@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: add workaround for 'timeout while wake up chip'
Jérôme Pouiller [Tue, 25 Aug 2020 08:58:28 +0000 (10:58 +0200)]
staging: wfx: add workaround for 'timeout while wake up chip'

The host and the device can be connected with a called Wake-Up GPIO.
When the host fall down this GPIO, it allows the device to enter in deep
sleep and no communication with the device is no more possible (the
device wakes up automatically on DTIM and fetch data if necessary).

So, before to communicate with the device, the driver have to raise the
Wake-up GPIO and then wait for an IRQ from the device.

Unfortunately, old firmwares have a race in sleep/wake-up process and
the device may never wake up. In this case, the IRQ is not sent and
driver complains with "timeout while wake up chip". Then, the driver
tries anyway to access the bus and an other error is raised by the bus.

Fortunately, when the bug occurs, it is possible to fall down the IRQ
and the device will eventually finish the sleep process. Then the driver
can wake it up normally.

The patch implements that workaround and add a retry limit in case
something goes very wrong.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200825085828.399505-12-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: remove useless extra jiffy
Jérôme Pouiller [Tue, 25 Aug 2020 08:58:27 +0000 (10:58 +0200)]
staging: wfx: remove useless extra jiffy

The initial developer has feared msecs_to_jiffies() could round down the
result. However, the documentation of msecs_to_jiffies() says that the
result is rounded upward. So the increment of the result of
msecs_to_jiffies() is not necessary.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200825085828.399505-11-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: enable powersave on probe
Jérôme Pouiller [Tue, 25 Aug 2020 08:58:26 +0000 (10:58 +0200)]
staging: wfx: enable powersave on probe

In the old days, ieee80211 powersave has some impact on the Rx speed.
These problems are solved for a long time now. There is no more reason
to not enabling it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200825085828.399505-10-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: scan while AP is supported
Jérôme Pouiller [Tue, 25 Aug 2020 08:58:25 +0000 (10:58 +0200)]
staging: wfx: scan while AP is supported

The device is able to scan while running an Access Point. Just declare
it.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200825085828.399505-9-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: fix potential use before init
Jérôme Pouiller [Tue, 25 Aug 2020 08:58:24 +0000 (10:58 +0200)]
staging: wfx: fix potential use before init

The trace below can appear:

    [83613.832200] INFO: trying to register non-static key.
    [83613.837248] the code is fine but needs lockdep annotation.
    [83613.842808] turning off the locking correctness validator.
    [83613.848375] CPU: 3 PID: 141 Comm: kworker/3:2H Tainted: G           O      5.6.13-silabs15 #2
    [83613.857019] Hardware name: BCM2835
    [83613.860605] Workqueue: events_highpri bh_work [wfx]
    [83613.865552] Backtrace:
    [83613.868041] [<c010f2cc>] (dump_backtrace) from [<c010f7b8>] (show_stack+0x20/0x24)
    [83613.881463] [<c010f798>] (show_stack) from [<c0d82138>] (dump_stack+0xe8/0x114)
    [83613.888882] [<c0d82050>] (dump_stack) from [<c01a02ec>] (register_lock_class+0x748/0x768)
    [83613.905035] [<c019fba4>] (register_lock_class) from [<c019da04>] (__lock_acquire+0x88/0x13dc)
    [83613.924192] [<c019d97c>] (__lock_acquire) from [<c019f6a4>] (lock_acquire+0xe8/0x274)
    [83613.942644] [<c019f5bc>] (lock_acquire) from [<c0daa5dc>] (_raw_spin_lock_irqsave+0x58/0x6c)
    [83613.961714] [<c0daa584>] (_raw_spin_lock_irqsave) from [<c0ab3248>] (skb_dequeue+0x24/0x78)
    [83613.974967] [<c0ab3224>] (skb_dequeue) from [<bf330db0>] (wfx_tx_queues_get+0x96c/0x1294 [wfx])
    [83613.989728] [<bf330444>] (wfx_tx_queues_get [wfx]) from [<bf320454>] (bh_work+0x454/0x26d8 [wfx])
    [83614.009337] [<bf320000>] (bh_work [wfx]) from [<c014c920>] (process_one_work+0x23c/0x7ec)
    [83614.028141] [<c014c6e4>] (process_one_work) from [<c014cf1c>] (worker_thread+0x4c/0x55c)
    [83614.046861] [<c014ced0>] (worker_thread) from [<c0154c04>] (kthread+0x138/0x168)
    [83614.064876] [<c0154acc>] (kthread) from [<c01010b4>] (ret_from_fork+0x14/0x20)
    [83614.072200] Exception stack(0xecad3fb0 to 0xecad3ff8)
    [83614.077323] 3fa0:                                     00000000 00000000 00000000 00000000
    [83614.085620] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [83614.093914] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000

Indeed, the code of wfx_add_interface() shows that the interface is
enabled to early. So, the spinlock associated with some skb_queue may
not yet initialized when wfx_tx_queues_get() is called.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200825085828.399505-8-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: fix frame reordering
Jérôme Pouiller [Tue, 25 Aug 2020 08:58:23 +0000 (10:58 +0200)]
staging: wfx: fix frame reordering

When mac80211 debug is enabled, the trace below appears:

    [60744.340037] wlan0: Rx A-MPDU request on aa:bb:cc:97:60:24 tid 0 result -524

This imply that ___ieee80211_start_rx_ba_session will prematurely exit
and frame reordering won't be enabled.

Fixes: e5da5fbd77411 ("staging: wfx: fix CCMP/TKIP replay protection")
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200825085828.399505-7-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: drop useless field from struct wfx_tx_priv
Jérôme Pouiller [Tue, 25 Aug 2020 08:58:22 +0000 (10:58 +0200)]
staging: wfx: drop useless field from struct wfx_tx_priv

The device need to receive a skb with necessary space for the ICV. So,
the driver adds this space before to send the frame.

Currently, once the frame is sent, the driver restore the original
content of the skb. However, this step is useless. Mac80211 don't do it
when software encryption is enabled.

Once we have removed this step, it appears that it is no more necessary
to keep hw_key in tx_priv. Then, it is possible to simplify a bunch of
code in the Tx path.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200825085828.399505-6-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: fix support for cipher AES_CMAC (multicast PMF)
Jérôme Pouiller [Tue, 25 Aug 2020 08:58:21 +0000 (10:58 +0200)]
staging: wfx: fix support for cipher AES_CMAC (multicast PMF)

When MFP is enabled, the multicast management frames are not protected,
in fact. Instead, but they should include an IE containing the MMIC of
the frames (i.e. a cryptographic signature).

Until now, the driver didn't correctly detect this kind of frames (they
are not marked protected but they are associated to a key) and didn't
ask to the device to encrypt them.

In add, the device is not able to generate the IE itself. Mac80211 has
to generate the IE and let the device compute the MMIC.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200825085828.399505-5-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: fix spaces around binary operators
Jérôme Pouiller [Tue, 25 Aug 2020 08:58:20 +0000 (10:58 +0200)]
staging: wfx: fix spaces around binary operators

A binary operator should be followed by exactly one space.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200825085828.399505-4-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: fix BA when MFP is disabled but BSS is MFP capable
Jérôme Pouiller [Tue, 25 Aug 2020 08:58:19 +0000 (10:58 +0200)]
staging: wfx: fix BA when MFP is disabled but BSS is MFP capable

The protection of the management frames is mainly done by mac80211.
However, frames for the management of the BlockAck sessions are directly
sent by the device. These frames have to be protected if MFP is in use.
So the driver has to pass the MFP configuration to the device.

Until now, the driver directly read the RSN IE of the BSS. However, it
didn't work when the BSS was MFP capable (ieee80211w=1) and the local
device has disabled MFP (ieee80211w=0).

This patch read the MFP information directly from the struct
ieee80211_sta. This information take into account the MFP negotiated
during the association. In addition, the code is far simpler.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200825085828.399505-3-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: improve usage of hif_map_link()
Jérôme Pouiller [Tue, 25 Aug 2020 08:58:18 +0000 (10:58 +0200)]
staging: wfx: improve usage of hif_map_link()

Until now, hif_map_link() get as argument the raw value for
map_link_flags when map_link_flags is defined as a bitfield. It was
error prone.

Now hif_map_link() takes explicit value for every flags of the
struct map_link_flags.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200825085828.399505-2-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: fix BA when device is AP and MFP is enabled
Jérôme Pouiller [Tue, 25 Aug 2020 08:58:17 +0000 (10:58 +0200)]
staging: wfx: fix BA when device is AP and MFP is enabled

The protection of the management frames is mainly done by mac80211.
However, frames for the management of the BlockAck sessions are directly
sent by the device. These frames have to be protected if MFP is in use.
So the driver has to pass the MFP configuration to the device.

Until now, the BlockAck management frames were completely unprotected
whatever the status of the MFP negotiation. So, some devices dropped
these frames.

The device has two knobs to control the MFP. One global and one per
station. Normally, the driver should always enable global MFP. Then it
should enable MFP on every station with which MFP was successfully
negotiated. Unfortunately, the older firmwares only provide the
global control.

So, this patch enable global MFP as it is exposed in the beacon. Then it
marks every station with which the MFP is effective.

Thus, the support for the old firmwares is not so bad. It may only
encounter some difficulties to negotiate BA sessions when the local
device (the AP) is MFP capable (ieee80211w=1) but the station is not.
The only solution for this case is to upgrade the firmware.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200825085828.399505-1-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wlan-ng: fix alignment to match open parentheses
Steff Richards [Mon, 24 Aug 2020 16:53:56 +0000 (18:53 +0200)]
staging: wlan-ng: fix alignment to match open parentheses

Indent a number of arguments so that they align with the opening
parentheses of the function calls. Issues found by checkpatch.

Signed-off-by: Steff Richards <steff.richards.the.third@gmail.com>
Link: https://lore.kernel.org/r/20200824165356.GA5204@steffpad
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agodrivers: staging: comedi: fixed duplicate words from checkpatch
Ethan Edwards [Tue, 25 Aug 2020 00:29:55 +0000 (20:29 -0400)]
drivers: staging: comedi: fixed duplicate words from checkpatch

Fixed various different checkpatch duplicate word warnings, the TODO
file said to fix checkpatch warnings.

Signed-off-by: Ethan Edwards <ethancarteredwards@gmail.com>
Link: https://lore.kernel.org/r/20200825002955.e3wvtwsoqqbc2cvl@archlaptop.localdomain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoStaging: sm750fb: Fix basic coding style issues
Timo A. Aranjo [Wed, 26 Aug 2020 01:21:01 +0000 (20:21 -0500)]
Staging: sm750fb: Fix basic coding style issues

The word "enought" was changed to read as "enough".
In addition to this, there was a missing new-line after varaible
declarations within a function.

Signed-off-by: Timo A. Aranjo <timo.aranjo@aol.com>
Link: https://lore.kernel.org/r/20200826012101.12162-1-timo.aranjo@aol.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: hikey9xx: update references inside the yaml files
Mauro Carvalho Chehab [Wed, 26 Aug 2020 09:32:12 +0000 (11:32 +0200)]
staging: hikey9xx: update references inside the yaml files

The references inside those files were not assuming that
they would end at the staging tree.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/809bce085b0a9a9ede74d619d160e1e04723709d.1598434228.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: spmi: hisi-spmi-controller: fix spelling mistake "controlller" -> "controller"
Colin Ian King [Thu, 20 Aug 2020 07:51:36 +0000 (08:51 +0100)]
staging: spmi: hisi-spmi-controller: fix spelling mistake "controlller" -> "controller"

There is a spelling mistake in the MODULE_ALIAS, fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/20200820075136.186199-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: kpc2000: kpc_dma: fix spelling mistake "for for" -> "for"
Colin Ian King [Tue, 18 Aug 2020 16:46:54 +0000 (17:46 +0100)]
staging: kpc2000: kpc_dma: fix spelling mistake "for for" -> "for"

There are a couple of duplicated "for" spelling mistakes in dev_err
error messages. Fix these.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200818164654.381588-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: hikey9xx: Kconfig: add regulator dependency
Mauro Carvalho Chehab [Tue, 18 Aug 2020 16:04:48 +0000 (18:04 +0200)]
staging: hikey9xx: Kconfig: add regulator dependency

The regulator driver needs it, as otherwise it will produce
errors when creating vmlinux.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/a287238bd0141aa68aae7d4cec4c1174a43b3e53.1597766680.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: emxx_udc: Allow for building on !ARM
Alex Dewar [Tue, 18 Aug 2020 15:11:29 +0000 (16:11 +0100)]
staging: emxx_udc: Allow for building on !ARM

Currently the module can only be test built on ARM, although it seems to
build fine on x86. Change this to allow for broader test coverage.

Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Link: https://lore.kernel.org/r/20200818151133.583382-1-alex.dewar90@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoMAINTAINERS: add an entry for HiSilicon 6421v600 drivers
Mauro Carvalho Chehab [Tue, 18 Aug 2020 14:58:58 +0000 (16:58 +0200)]
MAINTAINERS: add an entry for HiSilicon 6421v600 drivers

Add an entry for the SPMI, MFD and PMIC parts of the
HiSilicon 6421v600 support.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/14b009ef0255d61eeaf4273e9c36dafdb1e5e12f.1597762400.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agodt: document HiSilicon SPMI controller and mfd/regulator properties
Mauro Carvalho Chehab [Tue, 18 Aug 2020 14:58:57 +0000 (16:58 +0200)]
dt: document HiSilicon SPMI controller and mfd/regulator properties

Add documentation for the properties needed by the HiSilicon
6421v600 driver, and by the SPMI controller used to access
the chipset.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/56c40a260bf31edf7049f50586c63ee0d06e02cb.1597762400.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mfd: hi6421-spmi-pmic: Simplify the compatible string
Mauro Carvalho Chehab [Tue, 18 Aug 2020 14:58:56 +0000 (16:58 +0200)]
staging: mfd: hi6421-spmi-pmic: Simplify the compatible string

It is clear that this driver is for PMIC. So, get rid of
it at the compatible.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/12bdc9b4734e156098408d0d27256abdc91ac283.1597762400.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: spmi: hisi-spmi-controller: change compatible string
Mauro Carvalho Chehab [Tue, 18 Aug 2020 14:58:55 +0000 (16:58 +0200)]
staging: spmi: hisi-spmi-controller: change compatible string

Add the chipset name at the compatible string, as other
HiSilicon chipsets with SPMI bus might require something
different.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/f34062e82b5d5ee49aab4f9055b44e42e5023f0a.1597762400.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mfd: hi6421-spmi-pmic: get rid of interrupt properties
Mauro Carvalho Chehab [Tue, 18 Aug 2020 14:58:54 +0000 (16:58 +0200)]
staging: mfd: hi6421-spmi-pmic: get rid of interrupt properties

Both irqnum and irqarray properties reflect the same thing:
the number of bits and bytes for interrupts at this
chipset. E. g.:

irqnum = 8 x irqarray

This can be seen by the way pending interrupts are handled:

/* During probe time */
pmic->irqs = devm_kzalloc(dev, pmic->irqnum * sizeof(int), GFP_KERNEL);

/* While handling IRQs */
for (i = 0; i < pmic->irqarray; i++) {
pending = hi6421_spmi_pmic_read(pmic, (i + pmic->irq_addr));
pending &= 0xff;

for_each_set_bit(offset, &pending, 8)
generic_handle_irq(pmic->irqs[offset + i * 8]);

}

Going further, there are some logic at the driver which assumes
that irqarray is 2:

/* solve powerkey order */
if ((i == HISI_IRQ_KEY_NUM) &&
    ((pending & HISI_IRQ_KEY_VALUE) == HISI_IRQ_KEY_VALUE)) {
generic_handle_irq(pmic->irqs[HISI_IRQ_KEY_DOWN]);
generic_handle_irq(pmic->irqs[HISI_IRQ_KEY_UP]);
pending &= (~HISI_IRQ_KEY_VALUE);
}

As HISI_IRQ_KEY_DOWN and HISI_IRQ_KEY_UP are fixed values
and don't depend on irqnum/irqarray.

The IRQ addr and mask addr seem to be also fixed, based on some
comments at the OF parsing code. So, get rid of them too,
removing the of parsing function completely.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/e231244e42cb5b56240705cac2f987e11a078038.1597762400.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: hikey9xx: fix Kconfig dependency chain
Mauro Carvalho Chehab [Tue, 18 Aug 2020 14:58:53 +0000 (16:58 +0200)]
staging: hikey9xx: fix Kconfig dependency chain

Both the SPMI controller and the SPMI PMIC driver
depends on the SPMI bus support.

The dependency for the regulator is also wrong:
it should depends on the SPMI version of the HiSilicon 6421,
and not on the normal one.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/1b7e23500e7449593393115cc0954af441b0c730.1597762400.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: hikey9xx: add a TODO list
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:11:00 +0000 (09:11 +0200)]
staging: hikey9xx: add a TODO list

Place the things that are needed to be able to move those
drivers out of staging.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/bf3ebe32125646e0a87a59280392e8c6fda08488.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: code cleanup
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:59 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: code cleanup

Do some code cleanup in order to make it cleaner for moving
it out of staging in the future.

Suggested-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/32fadb359c1817992af78052e2d9448b8c5fc61f.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: add it to the building system
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:58 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: add it to the building system

Change the binding logic to ensure that the PMIC SPMI
driver will run before the regulator code and add it to the
building system.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/2992dc49945dcfb07c4bd96fa5c288c4e679701a.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: fix some coding style issues
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:57 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: fix some coding style issues

Fix the remaining issues complained by checkpatch.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/af5101fa2ab1d267ac5ac22603f95c6065ac110f.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: cleanup DT settings
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:56 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: cleanup DT settings

Currently, an array is used to store both vsel and enable
settings, mixing registers, masks and bit settings.

Change it in order to have one separate property for each.

This makes easier to understand the contents of the DT
file, and to describe it at the Documentation/.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/fd72215b0a7da55dd727c2d7bd01c047a46cdd2e.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: initialize ramp_delay
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:55 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: initialize ramp_delay

Without that, the regulator's core complains with:

       ldo17: ramp_delay not set

For now, use the enable time, as we don't have any datasheets from
this device.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/67df5456e4f23c88ab4fd9331eb8202c3952e5c5.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: add a driver-specific debug macro
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:54 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: add a driver-specific debug macro

Using dev_dbg() is not too nice, as, instead of printing the
name of the regulator, it prints "regulator.<number>", making
harder to associate what is happening with each ldo line.

So, add a debug-specific macro, which will print the rdev's
name, just like the regulator core.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/1690b8531b23910aa915bd2725410b926022c481.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: don't use usleep_range for off_on_delay
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:53 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: don't use usleep_range for off_on_delay

The regulator's core already handles it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/4f17adca2b04c401e5de5556700638648ce25c0c.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: convert to use get/set voltage_sel
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:52 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: convert to use get/set voltage_sel

As the supported LDOs on this driver are all using a selector,
change the implementation to use get_voltage_sel and
set_voltage_sel ops.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/1cf4f26540e65ffbb561c7d52e53f6be5bd63ac4.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: change namespace
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:51 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: change namespace

Rename the functions used internally inside the driver in
order for them to follow the driver's name.

While here, get rid of some unused definitions at the
header file.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/5cda96baef9374a096a7a0c8f76f60491b0084c7.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: better handle modes
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:50 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: better handle modes

Instead of implementing a custom set of properties, set
valid_modes_mask based on having or not a mask for enabling
the eco_mode.

This makes the code clearer, and remove some uneeded props
from DT.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/0f4ac5a4167bbca428c8507b6992acd8b3ebabd1.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: use shorter names for OF properties
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:49 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: use shorter names for OF properties

Simplify the names of the OF properties, in order to make
them similar to other drivers and to make easier to understand
what each property means.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/98f66100263940901ba59ec187919e9cf5e64f31.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: cleanup debug messages
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:48 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: cleanup debug messages

- use dev_foo() instead of pr_foo();
- cleanup the messages, making them more standard and easier
  to understand.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/2d17e168031340da73e1bd1c826289ceba2dbe8f.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: cleanup struct hisi_regulator
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:47 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: cleanup struct hisi_regulator

There are several fields on this struct that can be removed,
as they already exists at struct regulator_desc.

Remove them, cleaning up the code in the process.

While here, rename it to hi6421v600_regulator_info, in order
to better match the driver's name.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/648d48f11368a9869d760c2bd54bfbc3feb4f44c.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: change the binding logic
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:46 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: change the binding logic

Change the binding logic to ensure that the PMIC SPMI
driver will run before the regulator code and add it to the
building system.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/aa40d443dfc6c8e69e4c36fa79d15459762924e4.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: coding style fixups
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:45 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: coding style fixups

There are several issues on those drivers related to their
coding style. Solve most of them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/9ea7fdc004c7c44ae513b6c8f6c4a4493dd1ac61.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: port it to upstream
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:44 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: port it to upstream

The driver was originally written for Kernel 4.9. It needs to
be ported to upstream:

- Got rid of timeval;
- Removed a bogus dependency;
- Did cleanups at the header file.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/9e34400d2cc15ef501a8478f69a95c9abc5c4d8d.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: hi6421v600-regulator: get rid of unused code
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:43 +0000 (09:10 +0200)]
staging: regulator: hi6421v600-regulator: get rid of unused code

Get rid of the sysfs code and other parts of the driver
which aren't needed upstream.

If needed later, this patch can be (partially?) reversed.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/698b2c7bdc92e336d2559bc65415807499b0e3a8.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: regulator: add a regulator driver for HiSilicon 6421v600 SPMI PMIC
Mayulong [Mon, 17 Aug 2020 07:10:42 +0000 (09:10 +0200)]
staging: regulator: add a regulator driver for HiSilicon 6421v600 SPMI PMIC

Add the regulator driver for the LDO lines provided by the
HiSilicon 6421v600 SPMI PMIC device.

[mchehab+huawei@kernel.org: keep just the regulator driver on this patch,
 renaming it to better fit at upstream namespace]

The compete patch is at:
https://github.com/96boards-hikey/linux/commit/08464419fba2

Signed-off-by: Mayulong <mayulong1@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/6e5f6a811edf77575ddaa84ab6542cc646024423.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mfd: hi6421-spmi-pmic: cleanup the code
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:41 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: cleanup the code

There are several small cleanups that can be done in order to
make the code more prepared to be upstreamed.

Suggested-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/823792ba2f69e613629ab52a33e5728d54e2288b.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mfd: hi6421-spmi-pmic: add it to the building system
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:40 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: add it to the building system

Now that the driver is ready, place it at the build system.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/952e11ea1a33beaf67d6dc355d5c0f99ab4fb964.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mfd: hi6421-spmi-pmic: fix some coding style issues
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:39 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: fix some coding style issues

Checkpatch complains about some minor issues inside this
driver that were not addressed by the previous patch.

Address them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/84b53d20632c84cc60b8dadfe937f3c54b355cef.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mfd: hi6421-spmi-pmic: change namespace on its functions
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:38 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: change namespace on its functions

Rename the functions used internally inside the driver in
order for them to follow the driver's name.

While here, get rid of some unused definitions at the
header file.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/bfa8bf33f71612b1511d73269ca242d0d4e70940.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mfd: hi6421-spmi-pmic: cleanup OF properties
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:37 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: cleanup OF properties

Simplify the names of the DT properties and do some cleanups,
in order to better document them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/24ffcd28a17ee7b0940d8aabef556d172d5feddf.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mfd: hi6421-spmi-pmic: get rid of unused OF properties
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:36 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: get rid of unused OF properties

There are several OF properties that aren't used by Hikey 970,
and some are not even used inside the driver.

So, drop them, as as this makes easier to document what's
actually used.

If latter needed, those could be re-added later.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/332f96c178b81bf1e9908a1da2127f043909ae0c.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mfd: hi6421-spmi-pmic: change the binding logic
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:35 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: change the binding logic

Change the binding logic to ensure that the MFD driver
will be load after having the SPMI controller registered.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/eb50392ce68bb30f64c603572cdb9c91f93ea47b.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mfd: hi6421-spmi-pmic: cleanup hi6421-spmi-pmic.h header
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:34 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: cleanup hi6421-spmi-pmic.h header

There are several external vars that are defined there, which
are not needed anymore.

Get rid of them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/3dbc3f3876275404153da52b84e5dcef09faf644.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mfd: hi6421-spmi-pmic: get rid of the static vars
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:33 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: get rid of the static vars

There are several static vars inside this driver.

Get rid of them.

While here, add a SPDX header file.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/19c497fc2bb1d3a95863d92cac89869d5abe3f2e.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mfd: hi6421-spmi-pmic: deal with non-static functions
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:32 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: deal with non-static functions

Several functions aren't used outside the mfd driver. So,
either remove or make them static.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/d26323ab7be5b4efb73b1950b4daaa5959277449.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mfd: hi6421-spmi-pmic: get rid of unused code
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:31 +0000 (09:10 +0200)]
staging: mfd: hi6421-spmi-pmic: get rid of unused code

There are some checks there which could make sense for
downstream builds, but doesn't make much sense for
upstream ones. They came from the official Hikey970 tree
from Linaro, but even there, the commented-out code is not
set via other Kconfig vars.

So, let's just get rid of that. If needed later, this
patch can be (partially?) reversed.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/ecbef801f6c32ba0850ad9e5c534a4304807df3b.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: mfd: add a PMIC driver for HiSilicon 6421 SPMI version
Mayulong [Mon, 17 Aug 2020 07:10:30 +0000 (09:10 +0200)]
staging: mfd: add a PMIC driver for HiSilicon 6421 SPMI version

Add the PMIC SPMI driver for the HiSilicon 6421v600.

[mchehab+huawei@kernel.org: keep just the MFD driver on this patch,
 and renamed filenames to better match other upstream drivers]

 The compete patch is at:
https://github.com/96boards-hikey/linux/commit/08464419fba2

Signed-off-by: Mayulong <mayulong1@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/4ffb2694244baa47387e39e2c5d71243242c1fc1.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: spmi: hisi-spmi-controller: do some code cleanups
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:29 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: do some code cleanups

There are several minor things that can be cleanup in
order to make this driver more prepared for leaving staging.

Suggested-by: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/1fa33567e21f95942d901a299d92e434d4a24b8f.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: spmi: hisi-spmi-controller: add it to the building system
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:28 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: add it to the building system

Now that the driver was ported to upstream, add it as a
SPMI controller.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/5315331cf048cc72844080e5e8668c0dbac48f1f.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: spmi: hisi-spmi-controller: fix the dev_foo() logic
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:27 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: fix the dev_foo() logic

Right now, driver is printing some messages as:

[   33.833026] (NULL device *): spmi_read_cmd: id:0 addr:0x17, read value: 00

This is because dev_foo() are not using a device with a name
set. Change the logic for it to print it right.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/f647600d6e709f3dc3f92a64f1788f739c924330.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: spmi: hisi-spmi-controller: add debug when values are read/write
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:26 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: add debug when values are read/write

It is interesting to be able to check if the driver is doing
the right thing. So, add some debug macros to allow checking it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/11dc4583c41a9c5e2804114d6a7a87374d2a23b4.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: spmi: hisi-spmi-controller: use le32 macros where needed
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:25 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: use le32 macros where needed

Instead of manually using bswap_32(), just use the
le32 macros.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/927ac4f981649318dba399e46a1aa429c428cfa3.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: spmi: hisi-spmi-controller: adjust whitespaces at defines
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:24 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: adjust whitespaces at defines

Some defines are not aligned with tab=8, which is the
style defined on Linux. Adjust them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/4a3799b40379dbc3abcbd08827977247ccc26dcb.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: spmi: hisi-spmi-controller: fix a typo
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:23 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: fix a typo

chanel -> channel

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/49798ac555d498c0fd489567643c619c625360f5.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: spmi: hisi-spmi-controller: fix it to probe successfully
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:22 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: fix it to probe successfully

Add a MODULE_DEVICE_TABLE() to the driver.

Also, the current logic calls platform_set_drvdata(pdev, NULL)
if the driver succeeds loading.

While here, remove the .owner, as it is not needed upstream
anymore.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/122bd1c02f325094f4830ac79a86430fbe01e3d5.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: spmi: hisi-spmi-controller: coding style fixup
Mauro Carvalho Chehab [Mon, 17 Aug 2020 07:10:21 +0000 (09:10 +0200)]
staging: spmi: hisi-spmi-controller: coding style fixup

In order to prepare for upstream, fix most coding style issues.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/3cd60dd31e481a4f824f7085d70fc243ecbbb94f.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: spmi: add Hikey 970 SPMI controller driver
Mayulong [Mon, 17 Aug 2020 07:10:20 +0000 (09:10 +0200)]
staging: spmi: add Hikey 970 SPMI controller driver

Add the SPMI controller code required to use the Kirin 970
SPMI bus.

[mchehab+huawei@kernel.org: added just the SPMI controller on this patch]

The complete patch is at:

https://github.com/96boards-hikey/linux/commit/08464419fba2

Signed-off-by: Mayulong <mayulong1@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/b4810f476e41e7de4efdf28b42472ae4ffe7defe.1597647359.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: emxx_udc: Use standard BIT() macro
Alex Dewar [Tue, 18 Aug 2020 13:49:18 +0000 (14:49 +0100)]
staging: emxx_udc: Use standard BIT() macro

Currently emxx_udc.h defines bit values using local macros. Use the
standard one instead.

Also, combine bit values with bitwise-or rather than addition, as
suggested by Coccinelle.

Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Link: https://lore.kernel.org/r/20200818134922.409195-1-alex.dewar90@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: fix a handful of spelling mistakes
Colin Ian King [Thu, 6 Aug 2020 10:47:01 +0000 (11:47 +0100)]
staging: wfx: fix a handful of spelling mistakes

There are various spelling mistakes in comments and error messages.
Fix these.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200806104701.46123-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: remove 5 GHz code
Michael Straube [Thu, 13 Aug 2020 06:50:53 +0000 (08:50 +0200)]
staging: rtl8723bs: remove 5 GHz code

According to the TODO 5 GHz code should be removed.

- find and remove remaining code valid only for 5 GHz. Most of the obvious
  ones have been removed, but things like channel > 14 still exist.

Remove code for channels > 14 from rtw_get_center_ch().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200813065053.13883-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8192u: Do not use GFP_KERNEL in atomic context
Christophe JAILLET [Thu, 13 Aug 2020 17:34:58 +0000 (19:34 +0200)]
staging: rtl8192u: Do not use GFP_KERNEL in atomic context

'rtl8192_irq_rx_tasklet()' is a tasklet initialized in
'rtl8192_init_priv_task()'.
>From this function it is possible to allocate some memory with the
GFP_KERNEL flag, which is not allowed in the atomic context of a tasklet.

Use GFP_ATOMIC instead.

The call chain is:
  rtl8192_irq_rx_tasklet            (in r8192U_core.c)
    --> rtl8192_rx_nomal            (in r8192U_core.c)
      --> ieee80211_rx              (in ieee80211/ieee80211_rx.c)
        --> RxReorderIndicatePacket (in ieee80211/ieee80211_rx.c)

Fixes: 79a5ccd97209 ("staging: rtl8192u: fix large frame size compiler warning")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/20200813173458.758284-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: r8188eu: remove unnecessary type cast of rtw_netdev_priv() result
Ivan Safonov [Sat, 15 Aug 2020 20:33:07 +0000 (23:33 +0300)]
staging: r8188eu: remove unnecessary type cast of rtw_netdev_priv() result

The type cast
padapter = (struct adapter *)rtw_netdev_priv(dev);
do nothing because type of rtw_netdev_priv() result
is (struct adapter *).

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Link: https://lore.kernel.org/r/20200815203306.121039-1-insafonov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: greybus: Add identifier name to function definition argument
Asif Talybov [Sun, 16 Aug 2020 03:31:09 +0000 (10:31 +0700)]
staging: greybus: Add identifier name to function definition argument

WARNING: function definition argument 'struct gbphy_device *' should also
have an identifier name
+       int (*probe)(struct gbphy_device *,

WARNING: function definition argument 'struct gbphy_device *' should also
have an identifier name
+       void (*remove)(struct gbphy_device *);

Signed-off-by: Asif Talybov <talybov.asif@yandex.ru>
Link: https://lore.kernel.org/r/20200816033109.3930-1-talybov.asif@yandex.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoStaging: comedi: pcl726: fixed a spelling mistake
Lokesh Chebrolu [Fri, 7 Aug 2020 07:20:06 +0000 (12:50 +0530)]
Staging: comedi: pcl726: fixed a spelling mistake

Fixed a spelling mistake issue

Signed-off-by: Lokesh Chebrolu <lokeshch007@gmail.com>
Link: https://lore.kernel.org/r/1596784806-7130-1-git-send-email-lokeshch007@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wlan-ng: Remove repeated words in comments
Igor Matheus Andrade Torrente [Mon, 3 Aug 2020 02:20:22 +0000 (23:20 -0300)]
staging: wlan-ng: Remove repeated words in comments

Remove duplicate words in comments at prism2mib and prism2sta files.

Signed-off-by: Igor Matheus Andrade Torrente <igormtorrente@gmail.com>
Link: https://lore.kernel.org/r/20200803022022.501-1-igormtorrente@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: most: dim2: Add missing identifier name to function argument
Nícolas F. R. A. Prado [Sun, 2 Aug 2020 22:36:30 +0000 (22:36 +0000)]
staging: most: dim2: Add missing identifier name to function argument

A function definition argument should have an identifier name according
to checkpatch:

WARNING: function definition argument 'struct platform_device *' should
also have an identifier name

Name it pdev as that name is already used throughout the code.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@protonmail.com>
Link: https://lore.kernel.org/r/20200802223615.924307-1-nfraprado@protonmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: os_dep: fix brace coding style issue in sdio_intf.c
Mohammed Rushad [Sun, 2 Aug 2020 19:09:24 +0000 (00:39 +0530)]
staging: rtl8723bs: os_dep: fix brace coding style issue in sdio_intf.c

This is a patch to the sdio_intf.c file that fixes up an incorrectly
placed brace found by the checkpatch.pl tool

Signed-off-by: Mohammed Rushad <mohammedrushad@gmail.com>
Link: https://lore.kernel.org/r/20200802190924.19964-1-mohammedrushad@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: wfx: clear alignment style issues
Tomer Samara [Sun, 2 Aug 2020 15:01:57 +0000 (18:01 +0300)]
staging: wfx: clear alignment style issues

  Clear checkpatch alignment style issues in debug.c.
  CHECK: Alignment should match open parenthesis

Signed-off-by: Tomer Samara <tomersamara98@gmail.com>
Link: https://lore.kernel.org/r/20200802150157.GA3052@tsnow
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoStaging: rtl8192e: fix indent coding style issue in rtllib_tx.c
Mohammed Rushad [Sun, 2 Aug 2020 14:58:59 +0000 (20:28 +0530)]
Staging: rtl8192e: fix indent coding style issue in rtllib_tx.c

This is a patch to the rtllib_tx.c file that fixes fixes an improper
indent found by the checkpatch.pl tool

Signed-off-by: Mohammed Rushad <mohammedrushad@gmail.com>
Link: https://lore.kernel.org/r/20200802145859.14143-1-mohammedrushad@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: rtl8723bs: replace rtw_netdev_priv define with inline function
Ivan Safonov [Sun, 2 Aug 2020 12:42:50 +0000 (15:42 +0300)]
staging: rtl8723bs: replace rtw_netdev_priv define with inline function

The function guarantees type checking of arguments and return value.

Result of rtw_netdev_priv macro can be assigned to pointer
with incompatible type without warning. The function allow compiler
to perform this check.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Link: https://lore.kernel.org/r/20200802124249.101341-1-insafonov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agostaging: ion: fix spelling mistake in function name "detatch" -> "detach"
Colin Ian King [Wed, 5 Aug 2020 11:26:55 +0000 (12:26 +0100)]
staging: ion: fix spelling mistake in function name "detatch" -> "detach"

There is a spelling mistake in the function name ion_dma_buf_detatch.
Fix it by removing the extraneous t.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Hridya Valsaraju <hridya@google.com>
Link: https://lore.kernel.org/r/20200805112655.17696-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4 years agoLinux 5.9-rc1
Linus Torvalds [Sun, 16 Aug 2020 20:04:57 +0000 (13:04 -0700)]
Linux 5.9-rc1

4 years agoMerge tag 'io_uring-5.9-2020-08-15' of git://git.kernel.dk/linux-block
Linus Torvalds [Sun, 16 Aug 2020 17:55:12 +0000 (10:55 -0700)]
Merge tag 'io_uring-5.9-2020-08-15' of git://git.kernel.dk/linux-block

Pull io_uring fixes from Jens Axboe:
 "A few differerent things in here.

  Seems like syzbot got some more io_uring bits wired up, and we got a
  handful of reports and the associated fixes are in here.

  General fixes too, and a lot of them marked for stable.

  Lastly, a bit of fallout from the async buffered reads, where we now
  more easily trigger short reads. Some applications don't really like
  that, so the io_read() code now handles short reads internally, and
  got a cleanup along the way so that it's now easier to read (and
  documented). We're now passing tests that failed before"

* tag 'io_uring-5.9-2020-08-15' of git://git.kernel.dk/linux-block:
  io_uring: short circuit -EAGAIN for blocking read attempt
  io_uring: sanitize double poll handling
  io_uring: internally retry short reads
  io_uring: retain iov_iter state over io_read/io_write calls
  task_work: only grab task signal lock when needed
  io_uring: enable lookup of links holding inflight files
  io_uring: fail poll arm on queue proc failure
  io_uring: hold 'ctx' reference around task_work queue + execute
  fs: RWF_NOWAIT should imply IOCB_NOIO
  io_uring: defer file table grabbing request cleanup for locked requests
  io_uring: add missing REQ_F_COMP_LOCKED for nested requests
  io_uring: fix recursive completion locking on oveflow flush
  io_uring: use TWA_SIGNAL for task_work uncondtionally
  io_uring: account locked memory before potential error case
  io_uring: set ctx sq/cq entry count earlier
  io_uring: Fix NULL pointer dereference in loop_rw_iter()
  io_uring: add comments on how the async buffered read retry works
  io_uring: io_async_buf_func() need not test page bit

4 years agoparisc: fix PMD pages allocation by restoring pmd_alloc_one()
Mike Rapoport [Sun, 16 Aug 2020 14:24:03 +0000 (17:24 +0300)]
parisc: fix PMD pages allocation by restoring pmd_alloc_one()

Commit 1355c31eeb7e ("asm-generic: pgalloc: provide generic pmd_alloc_one()
and pmd_free_one()") converted parisc to use generic version of
pmd_alloc_one() but it missed the fact that parisc uses order-1 pages for
PMD.

Restore the original version of pmd_alloc_one() for parisc, just use
GFP_PGTABLE_KERNEL that implies __GFP_ZERO instead of GFP_KERNEL and
memset.

Fixes: 1355c31eeb7e ("asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one()")
Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Tested-by: Meelis Roos <mroos@linux.ee>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: https://lkml.kernel.org/r/9f2b5ebd-e4a4-0fa1-6cd3-4b9f6892d1ad@linux.ee
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
4 years agoMerge tag 'block-5.9-2020-08-14' of git://git.kernel.dk/linux-block
Linus Torvalds [Sun, 16 Aug 2020 03:36:42 +0000 (20:36 -0700)]
Merge tag 'block-5.9-2020-08-14' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
 "A few fixes on the block side of things:

   - Discard granularity fix (Coly)

   - rnbd cleanups (Guoqing)

   - md error handling fix (Dan)

   - md sysfs fix (Junxiao)

   - Fix flush request accounting, which caused an IO slowdown for some
     configurations (Ming)

   - Properly propagate loop flag for partition scanning (Lennart)"

* tag 'block-5.9-2020-08-14' of git://git.kernel.dk/linux-block:
  block: fix double account of flush request's driver tag
  loop: unset GENHD_FL_NO_PART_SCAN on LOOP_CONFIGURE
  rnbd: no need to set bi_end_io in rnbd_bio_map_kern
  rnbd: remove rnbd_dev_submit_io
  md-cluster: Fix potential error pointer dereference in resize_bitmaps()
  block: check queue's limits.discard_granularity in __blkdev_issue_discard()
  md: get sysfs entry after redundancy attr group create

4 years agoMerge tag 'riscv-for-linus-5.9-mw1' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 16 Aug 2020 01:54:42 +0000 (18:54 -0700)]
Merge tag 'riscv-for-linus-5.9-mw1' of git://git./linux/kernel/git/riscv/linux

Pull RISC-V fix from Palmer Dabbelt:
 "I collected a single fix during the merge window: we managed to break
  the early trap setup on !MMU, this fixes it"

* tag 'riscv-for-linus-5.9-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
  riscv: Setup exception vector for nommu platform

4 years agoMerge tag 'sh-for-5.9' of git://git.libc.org/linux-sh
Linus Torvalds [Sun, 16 Aug 2020 01:50:32 +0000 (18:50 -0700)]
Merge tag 'sh-for-5.9' of git://git.libc.org/linux-sh

Pull arch/sh updates from Rich Felker:
 "Cleanup, SECCOMP_FILTER support, message printing fixes, and other
  changes to arch/sh"

* tag 'sh-for-5.9' of git://git.libc.org/linux-sh: (34 commits)
  sh: landisk: Add missing initialization of sh_io_port_base
  sh: bring syscall_set_return_value in line with other architectures
  sh: Add SECCOMP_FILTER
  sh: Rearrange blocks in entry-common.S
  sh: switch to copy_thread_tls()
  sh: use the generic dma coherent remap allocator
  sh: don't allow non-coherent DMA for NOMMU
  dma-mapping: consolidate the NO_DMA definition in kernel/dma/Kconfig
  sh: unexport register_trapped_io and match_trapped_io_handler
  sh: don't include <asm/io_trapped.h> in <asm/io.h>
  sh: move the ioremap implementation out of line
  sh: move ioremap_fixed details out of <asm/io.h>
  sh: remove __KERNEL__ ifdefs from non-UAPI headers
  sh: sort the selects for SUPERH alphabetically
  sh: remove -Werror from Makefiles
  sh: Replace HTTP links with HTTPS ones
  arch/sh/configs: remove obsolete CONFIG_SOC_CAMERA*
  sh: stacktrace: Remove stacktrace_ops.stack()
  sh: machvec: Modernize printing of kernel messages
  sh: pci: Modernize printing of kernel messages
  ...

4 years agoio_uring: short circuit -EAGAIN for blocking read attempt
Jens Axboe [Sat, 15 Aug 2020 22:58:42 +0000 (15:58 -0700)]
io_uring: short circuit -EAGAIN for blocking read attempt

One case was missed in the short IO retry handling, and that's hitting
-EAGAIN on a blocking attempt read (eg from io-wq context). This is a
problem on sockets that are marked as non-blocking when created, they
don't carry any REQ_F_NOWAIT information to help us terminate them
instead of perpetually retrying.

Fixes: 227c0c9673d8 ("io_uring: internally retry short reads")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoio_uring: sanitize double poll handling
Jens Axboe [Sat, 15 Aug 2020 18:44:50 +0000 (11:44 -0700)]
io_uring: sanitize double poll handling

There's a bit of confusion on the matching pairs of poll vs double poll,
depending on if the request is a pure poll (IORING_OP_POLL_ADD) or
poll driven retry.

Add io_poll_get_double() that returns the double poll waitqueue, if any,
and io_poll_get_single() that returns the original poll waitqueue. With
that, remove the argument to io_poll_remove_double().

Finally ensure that wait->private is cleared once the double poll handler
has run, so that remove knows it's already been seen.

Cc: stable@vger.kernel.org # v5.8
Reported-by: syzbot+7f617d4a9369028b8a2c@syzkaller.appspotmail.com
Fixes: 18bceab101ad ("io_uring: allow POLL_ADD with double poll_wait() users")
Signed-off-by: Jens Axboe <axboe@kernel.dk>