]> Git Repo - linux.git/log
linux.git
5 years agoMerge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 12 Sep 2019 10:02:00 +0000 (11:02 +0100)]
Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq fix from Ingo Molnar:
 "Fix a race in the IRQ resend mechanism, which can result in a NULL
  dereference crash"

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  genirq: Prevent NULL pointer dereference in resend_irqs()

5 years agoMerge tag 'pinctrl-v5.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
Linus Torvalds [Thu, 12 Sep 2019 09:58:47 +0000 (10:58 +0100)]
Merge tag 'pinctrl-v5.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control fix from Linus Walleij:
 "Hopefully last pin control fix: a single patch for some Aspeed
  problems. The BMCs are much happier now"

* tag 'pinctrl-v5.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: aspeed: Fix spurious mux failures on the AST2500

5 years agogpiolib: of: add a fallback for wlf,reset GPIO name
Dmitry Torokhov [Wed, 11 Sep 2019 07:52:05 +0000 (00:52 -0700)]
gpiolib: of: add a fallback for wlf,reset GPIO name

The old Arizona binding did not use -gpio or -gpios suffix, so
devm_gpiod_get() does not work for it. As it is the one of a few users
of devm_gpiod_get_from_of_node() API that I want to remove, I'd rather
have a small quirk in the gpiolib OF handler, and switch Arizona
driver to devm_gpiod_get().

Signed-off-by: Dmitry Torokhov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
5 years agogpio: htc-egpio: Remove unused exported htc_egpio_get_wakeup_irq()
Geert Uytterhoeven [Tue, 10 Sep 2019 14:15:29 +0000 (16:15 +0200)]
gpio: htc-egpio: Remove unused exported htc_egpio_get_wakeup_irq()

This function was never used upstream, and is a relic of the original
handhelds.org code the htc-egpio driver was based on.

Signed-off-by: Geert Uytterhoeven <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
5 years agoMerge tag 'gpio-v5.3-6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux...
Linus Torvalds [Thu, 12 Sep 2019 08:53:38 +0000 (09:53 +0100)]
Merge tag 'gpio-v5.3-6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
 "I don't really like to send so many fixes at the very last minute, but
  the bug-sport activity is unpredictable.

  Four fixes, three are -stable material that will go everywhere, one is
  for the current cycle:

   - An ACPI DSDT error fixup of the type we always see and Hans
     invariably gets to fix.

   - A OF quirk fix for the current release (v5.3)

   - Some consistency checks on the userspace ABI.

   - A memory leak"

* tag 'gpio-v5.3-6' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpiolib: acpi: Add gpiolib_acpi_run_edge_events_on_boot option and blacklist
  gpiolib: of: fix fallback quirks handling
  gpio: fix line flag validation in lineevent_create
  gpio: fix line flag validation in linehandle_create
  gpio: mockup: add missing single_release()

5 years agopinctrl: aspeed: Fix spurious mux failures on the AST2500
Andrew Jeffery [Thu, 29 Aug 2019 07:17:38 +0000 (16:47 +0930)]
pinctrl: aspeed: Fix spurious mux failures on the AST2500

Commit 674fa8daa8c9 ("pinctrl: aspeed-g5: Delay acquisition of regmaps")
was determined to be a partial fix to the problem of acquiring the LPC
Host Controller and GFX regmaps: The AST2500 pin controller may need to
fetch syscon regmaps during expression evaluation as well as when
setting mux state. For example, this case is hit by attempting to export
pins exposing the LPC Host Controller as GPIOs.

An optional eval() hook is added to the Aspeed pinmux operation struct
and called from aspeed_sig_expr_eval() if the pointer is set by the
SoC-specific driver. This enables the AST2500 to perform the custom
action of acquiring its regmap dependencies as required.

John Wang tested the fix on an Inspur FP5280G2 machine (AST2500-based)
where the issue was found, and I've booted the fix on Witherspoon
(AST2500) and Palmetto (AST2400) machines, and poked at relevant pins
under QEMU by forcing mux configurations via devmem before exporting
GPIOs to exercise the driver.

Fixes: 7d29ed88acbb ("pinctrl: aspeed: Read and write bits in LPC and GFX controllers")
Fixes: 674fa8daa8c9 ("pinctrl: aspeed-g5: Delay acquisition of regmaps")
Reported-by: John Wang <[email protected]>
Tested-by: John Wang <[email protected]>
Signed-off-by: Andrew Jeffery <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
5 years agoMerge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net...
David S. Miller [Wed, 11 Sep 2019 23:05:52 +0000 (00:05 +0100)]
Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates 2019-09-11

This series contains fixes to ixgbe.

Alex fixes up the adaptive ITR scheme for ixgbe which could result in a
value that was either 0 or something less than 10 which was causing
issues with hardware features, like RSC, that do not function well with
ITR values that low.

Ilya Maximets fixes the ixgbe driver to limit the number of transmit
descriptors to clean by the number of transmit descriptors used in the
transmit ring, so that the driver does not try to "double" clean the
same descriptors.
====================

Signed-off-by: David S. Miller <[email protected]>
5 years agogpio: remove explicit comparison with 0
Saiyam Doshi [Sat, 7 Sep 2019 17:39:10 +0000 (23:09 +0530)]
gpio: remove explicit comparison with 0

No need to compare return value with 0. In case of non-zero
return value, the if condition will be true.

This makes intent a bit more clear to the reader.
"if (x) then", compared to "if (x is not zero) then".

Signed-off-by: Saiyam Doshi <[email protected]>
Link: https://lore.kernel.org/r/20190907173910.GA9547@SD
Signed-off-by: Linus Walleij <[email protected]>
5 years agotcp: fix tcp_ecn_withdraw_cwr() to clear TCP_ECN_QUEUE_CWR
Neal Cardwell [Mon, 9 Sep 2019 20:56:02 +0000 (16:56 -0400)]
tcp: fix tcp_ecn_withdraw_cwr() to clear TCP_ECN_QUEUE_CWR

Fix tcp_ecn_withdraw_cwr() to clear the correct bit:
TCP_ECN_QUEUE_CWR.

Rationale: basically, TCP_ECN_DEMAND_CWR is a bit that is purely about
the behavior of data receivers, and deciding whether to reflect
incoming IP ECN CE marks as outgoing TCP th->ece marks. The
TCP_ECN_QUEUE_CWR bit is purely about the behavior of data senders,
and deciding whether to send CWR. The tcp_ecn_withdraw_cwr() function
is only called from tcp_undo_cwnd_reduction() by data senders during
an undo, so it should zero the sender-side state,
TCP_ECN_QUEUE_CWR. It does not make sense to stop the reflection of
incoming CE bits on incoming data packets just because outgoing
packets were spuriously retransmitted.

The bug has been reproduced with packetdrill to manifest in a scenario
with RFC3168 ECN, with an incoming data packet with CE bit set and
carrying a TCP timestamp value that causes cwnd undo. Before this fix,
the IP CE bit was ignored and not reflected in the TCP ECE header bit,
and sender sent a TCP CWR ('W') bit on the next outgoing data packet,
even though the cwnd reduction had been undone.  After this fix, the
sender properly reflects the CE bit and does not set the W bit.

Note: the bug actually predates 2005 git history; this Fixes footer is
chosen to be the oldest SHA1 I have tested (from Sep 2007) for which
the patch applies cleanly (since before this commit the code was in a
.h file).

Fixes: bdf1ee5d3bd3 ("[TCP]: Move code from tcp_ecn.h to tcp*.c and tcp.h & remove it")
Signed-off-by: Neal Cardwell <[email protected]>
Acked-by: Yuchung Cheng <[email protected]>
Acked-by: Soheil Hassas Yeganeh <[email protected]>
Cc: Eric Dumazet <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agovhost: make sure log_num < in_num
yongduan [Wed, 11 Sep 2019 09:44:24 +0000 (17:44 +0800)]
vhost: make sure log_num < in_num

The code assumes log_num < in_num everywhere, and that is true as long as
in_num is incremented by descriptor iov count, and log_num by 1. However
this breaks if there's a zero sized descriptor.

As a result, if a malicious guest creates a vring desc with desc.len = 0,
it may cause the host kernel to crash by overflowing the log array. This
bug can be triggered during the VM migration.

There's no need to log when desc.len = 0, so just don't increment log_num
in this case.

Fixes: 3a4d5c94e959 ("vhost_net: a kernel-level virtio server")
Cc: [email protected]
Reviewed-by: Lidong Chen <[email protected]>
Signed-off-by: ruippan <[email protected]>
Signed-off-by: yongduan <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Tyler Hicks <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
5 years agovhost: block speculation of translated descriptors
Michael S. Tsirkin [Sun, 8 Sep 2019 11:04:08 +0000 (07:04 -0400)]
vhost: block speculation of translated descriptors

iovec addresses coming from vhost are assumed to be
pre-validated, but in fact can be speculated to a value
out of range.

Userspace address are later validated with array_index_nospec so we can
be sure kernel info does not leak through these addresses, but vhost
must also not leak userspace info outside the allowed memory table to
guests.

Following the defence in depth principle, make sure
the address is not validated out of node range.

Signed-off-by: Michael S. Tsirkin <[email protected]>
Cc: [email protected]
Acked-by: Jason Wang <[email protected]>
Tested-by: Jason Wang <[email protected]>
5 years agoixgbe: fix double clean of Tx descriptors with xdp
Ilya Maximets [Thu, 22 Aug 2019 17:12:37 +0000 (20:12 +0300)]
ixgbe: fix double clean of Tx descriptors with xdp

Tx code doesn't clear the descriptors' status after cleaning.
So, if the budget is larger than number of used elems in a ring, some
descriptors will be accounted twice and xsk_umem_complete_tx will move
prod_tail far beyond the prod_head breaking the completion queue ring.

Fix that by limiting the number of descriptors to clean by the number
of used descriptors in the Tx ring.

'ixgbe_clean_xdp_tx_irq()' function refactored to look more like
'ixgbe_xsk_clean_tx_ring()' since we're allowed to directly use
'next_to_clean' and 'next_to_use' indexes.

CC: [email protected]
Fixes: 8221c5eba8c1 ("ixgbe: add AF_XDP zero-copy Tx support")
Signed-off-by: Ilya Maximets <[email protected]>
Tested-by: William Tu <[email protected]>
Tested-by: Eelco Chaudron <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
5 years agoixgbe: Prevent u8 wrapping of ITR value to something less than 10us
Alexander Duyck [Wed, 4 Sep 2019 15:07:11 +0000 (08:07 -0700)]
ixgbe: Prevent u8 wrapping of ITR value to something less than 10us

There were a couple cases where the ITR value generated via the adaptive
ITR scheme could exceed 126. This resulted in the value becoming either 0
or something less than 10. Switching back and forth between a value less
than 10 and a value greater than 10 can cause issues as certain hardware
features such as RSC to not function well when the ITR value has dropped
that low.

CC: [email protected]
Fixes: b4ded8327fea ("ixgbe: Update adaptive ITR algorithm")
Reported-by: Gregg Leventhal <[email protected]>
Signed-off-by: Alexander Duyck <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
5 years agoMerge branch 'regulator-5.4' into regulator-next
Mark Brown [Wed, 11 Sep 2019 15:00:19 +0000 (16:00 +0100)]
Merge branch 'regulator-5.4' into regulator-next

5 years agoMerge branch 'regulator-5.3' into regulator-linus
Mark Brown [Wed, 11 Sep 2019 15:00:17 +0000 (16:00 +0100)]
Merge branch 'regulator-5.3' into regulator-linus

5 years agospi: bcm2835: Speed up RX-only DMA transfers by zero-filling TX FIFO
Lukas Wunner [Wed, 11 Sep 2019 10:15:30 +0000 (12:15 +0200)]
spi: bcm2835: Speed up RX-only DMA transfers by zero-filling TX FIFO

The BCM2835 SPI driver currently sets the SPI_CONTROLLER_MUST_TX flag.
When performing an RX-only transfer, this flag causes the SPI core to
allocate and DMA-map a dummy buffer which is copied to the TX FIFO.
The dummy buffer is necessary because the chip is not capable of
automatically clocking out null bytes.

Avoid the overhead induced by the dummy buffer by preallocating a
reusable DMA transaction which fills the TX FIFO by cyclically copying
from the zero page.  The transaction requires very little CPU time to
submit and generates no interrupts while running.  Specifics are
provided in kerneldoc comments.

[Nathan Chancellor contributed a DMA mapping fixup for an early version
of this commit, hence his Signed-off-by.]

Tested-by: Nuno Sá <[email protected]>
Tested-by: Noralf Trønnes <[email protected]>
Signed-off-by: Nathan Chancellor <[email protected]>
Signed-off-by: Lukas Wunner <[email protected]>
Acked-by: Stefan Wahren <[email protected]>
Acked-by: Martin Sperl <[email protected]>
Cc: Robert Jarzmik <[email protected]>
Link: https://lore.kernel.org/r/f45920af18dbf06e34129bbc406f53dc9c5d1075.1568187525.git.lukas@wunner.de
Signed-off-by: Mark Brown <[email protected]>
5 years agospi: bcm2835: Speed up TX-only DMA transfers by clearing RX FIFO
Lukas Wunner [Wed, 11 Sep 2019 10:15:30 +0000 (12:15 +0200)]
spi: bcm2835: Speed up TX-only DMA transfers by clearing RX FIFO

The BCM2835 SPI driver currently sets the SPI_CONTROLLER_MUST_RX flag.
When performing a TX-only transfer, this flag causes the SPI core to
allocate and DMA-map a dummy buffer into which the RX FIFO contents are
copied.  The dummy buffer is necessary because the chip is not capable
of disabling the receiver or automatically throwing away received data.
Not reading the RX FIFO isn't an option either since transmission is
halted once it's full.

Avoid the overhead induced by the dummy buffer by preallocating a
reusable DMA transaction which cyclically clears the RX FIFO.  The
transaction requires very little CPU time to submit and generates no
interrupts while running.  Specifics are provided in kerneldoc comments.

With a ks8851 Ethernet chip attached to the SPI controller, I am seeing
a 30 us reduction in ping time with this commit (1.819 ms vs. 1.849 ms,
average of 100,000 packets) as well as a 2% reduction in CPU time
(75:08 vs. 76:39 for transmission of 5 GByte over the SPI bus).

The commit uses the TX DMA interrupt to signal completion of a transfer.
This interrupt is raised once all bytes have been written to the
TX FIFO and it is then necessary to busy-wait for the TX FIFO to become
empty before the transfer can be finalized.  As an alternative approach,
I have explored using the SPI controller's DONE interrupt to detect
completion.  This interrupt is signaled when the TX FIFO becomes empty,
avoiding the need to busy-wait.  However latency deteriorates compared
to the present commit and surprisingly, CPU time is slightly higher as
well:

It turns out that in 45% of the cases, no busy-waiting is needed at all
and in 76% of the cases, less than 10 busy-wait iterations are
sufficient for the TX FIFO to drain.  This was measured on an RT kernel.
On a vanilla kernel, wakeup latency is worse and thus fewer iterations
are needed.  The measurements were made with an SPI clock of 20 MHz,
they may differ slightly for slower or faster clock speeds.

Previously we always used the RX DMA interrupt to signal completion of a
transfer.  Using the TX DMA interrupt now introduces a race condition:
TX DMA is always started before RX DMA so that bytes are already clocked
out while RX DMA is still being set up.  But if a TX-only transfer is
very short, then the TX DMA interrupt may occur before RX DMA is set up.
If the interrupt happens to occur on the same CPU, setup of RX DMA may
even be delayed until after the interrupt was handled.

I've solved this by having the TX DMA callback clear the RX FIFO while
busy-waiting for the TX FIFO to drain, thus avoiding a dependency on
setup of RX DMA.  Additionally, I am using a lock-free mechanism with
two flags, tx_dma_active and rx_dma_active plus memory barriers to
terminate RX DMA either by the TX DMA callback or immediately after
setting it up, whichever wins the race.  I've explored an alternative
approach which temporarily disables the TX DMA callback until RX DMA
has been set up (using tasklet_disable(), local_bh_disable() or
local_irq_save()), but the performance was minimally worse.

[Nathan Chancellor contributed a DMA mapping fixup for an early version
of this commit, hence his Signed-off-by.]

Tested-by: Nuno Sá <[email protected]>
Tested-by: Noralf Trønnes <[email protected]>
Signed-off-by: Nathan Chancellor <[email protected]>
Signed-off-by: Lukas Wunner <[email protected]>
Acked-by: Stefan Wahren <[email protected]>
Acked-by: Martin Sperl <[email protected]>
Cc: Robert Jarzmik <[email protected]>
Link: https://lore.kernel.org/r/874949385f28251e2dcaa9494e39a27b50e9f9e4.1568187525.git.lukas@wunner.de
Signed-off-by: Mark Brown <[email protected]>
5 years agodmaengine: bcm2835: Avoid accessing memory when copying zeroes
Lukas Wunner [Wed, 11 Sep 2019 10:15:30 +0000 (12:15 +0200)]
dmaengine: bcm2835: Avoid accessing memory when copying zeroes

The BCM2835 DMA controller is capable of synthesizing zeroes instead of
copying them from a source address. The feature is enabled by setting
the SRC_IGNORE bit in the Transfer Information field of a Control Block:

"Do not perform source reads.
 In addition, destination writes will zero all the write strobes.
 This is used for fast cache fill operations."
https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf

The feature is only available on 8 of the 16 channels. The others are
so-called "lite" channels with a limited feature set and performance.

Enable the feature if a cyclic transaction copies from the zero page.
This reduces traffic on the memory bus.

A forthcoming use case is the BCM2835 SPI driver, which will cyclically
copy from the zero page to the TX FIFO. The idea to use SRC_IGNORE was
taken from an ancient GitHub conversation between Martin and Noralf:
https://github.com/msperl/spi-bcm2835/issues/13#issuecomment-98180451

Tested-by: Nuno Sá <[email protected]>
Tested-by: Noralf Trønnes <[email protected]>
Signed-off-by: Lukas Wunner <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Acked-by: Stefan Wahren <[email protected]>
Acked-by: Martin Sperl <[email protected]>
Cc: Florian Kauer <[email protected]>
Link: https://lore.kernel.org/r/b2286c904408745192e4beb3de3c88f73e4a7210.1568187525.git.lukas@wunner.de
Signed-off-by: Mark Brown <[email protected]>
5 years agospi: bcm2835: Cache CS register value for ->prepare_message()
Lukas Wunner [Wed, 11 Sep 2019 10:15:30 +0000 (12:15 +0200)]
spi: bcm2835: Cache CS register value for ->prepare_message()

The BCM2835 SPI driver needs to set up the clock polarity in its
->prepare_message() hook before spi_transfer_one_message() asserts chip
select to avoid a gratuitous clock signal edge (cf. commit acace73df2c1
("spi: bcm2835: set up spi-mode before asserting cs-gpio")).

Precalculate the CS register value (which selects the clock polarity)
once in ->setup() and use that cached value in ->prepare_message() and
->transfer_one().  This avoids one MMIO read per message and one per
transfer, yielding a small latency improvement.  Additionally, a
forthcoming commit will use the precalculated value to derive the
register value for clearing the RX FIFO, which will eliminate the need
for an RX dummy buffer when performing TX-only DMA transfers.

Tested-by: Nuno Sá <[email protected]>
Tested-by: Noralf Trønnes <[email protected]>
Signed-off-by: Lukas Wunner <[email protected]>
Acked-by: Stefan Wahren <[email protected]>
Acked-by: Martin Sperl <[email protected]>
Link: https://lore.kernel.org/r/d17c1d7fcdc97fffa961b8737cfd80eeb14f9416.1568187525.git.lukas@wunner.de
Signed-off-by: Mark Brown <[email protected]>
5 years agodmaengine: bcm2835: Document struct bcm2835_dmadev
Lukas Wunner [Wed, 11 Sep 2019 10:15:30 +0000 (12:15 +0200)]
dmaengine: bcm2835: Document struct bcm2835_dmadev

Document the BCM2835 DMA driver's device data structure so that upcoming
commits may add further members with proper kerneldoc.

Tested-by: Nuno Sá <[email protected]>
Tested-by: Noralf Trønnes <[email protected]>
Signed-off-by: Lukas Wunner <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Acked-by: Stefan Wahren <[email protected]>
Acked-by: Martin Sperl <[email protected]>
Cc: Florian Kauer <[email protected]>
Link: https://lore.kernel.org/r/78648f80f67d97bb7beecc1b9be6b6e4a45bc1d8.1568187525.git.lukas@wunner.de
Signed-off-by: Mark Brown <[email protected]>
5 years agospi: Guarantee cacheline alignment of driver-private data
Lukas Wunner [Wed, 11 Sep 2019 10:15:30 +0000 (12:15 +0200)]
spi: Guarantee cacheline alignment of driver-private data

__spi_alloc_controller() uses a single allocation to accommodate struct
spi_controller and the driver-private data, but places the latter behind
the former.  This order does not guarantee cacheline alignment of the
driver-private data.  (It does guarantee cacheline alignment of struct
spi_controller but the structure doesn't make any use of that property.)

Round up struct spi_controller to cacheline size.  A forthcoming commit
leverages this to grant DMA access to driver-private data of the BCM2835
SPI master.

An alternative, less economical approach would be to use two allocations.

A third approach consists of reversing the order to conserve memory.
But Mark Brown is concerned that it may result in a performance penalty
on architectures that don't like unaligned accesses.

Signed-off-by: Lukas Wunner <[email protected]>
Link: https://lore.kernel.org/r/01625b9b26b93417fb09d2c15ad02dfe9cdbbbe5.1568187525.git.lukas@wunner.de
Signed-off-by: Mark Brown <[email protected]>
5 years agodmaengine: bcm2835: Allow reusable descriptors
Lukas Wunner [Wed, 11 Sep 2019 10:15:30 +0000 (12:15 +0200)]
dmaengine: bcm2835: Allow reusable descriptors

The DMA engine API requires DMA drivers to explicitly allow that
descriptors are prepared once and reused multiple times. Only a
single driver makes use of this functionality so far (pxa_dma.c,
to speed up pxa_camera.c).

We're about to add another use case for reusable descriptors in
the BCM2835 SPI driver, so allow that in the BCM2835 DMA driver.

Tested-by: Nuno Sá <[email protected]>
Tested-by: Noralf Trønnes <[email protected]>
Signed-off-by: Lukas Wunner <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Acked-by: Stefan Wahren <[email protected]>
Acked-by: Martin Sperl <[email protected]>
Cc: Florian Kauer <[email protected]>
Cc: Robert Jarzmik <[email protected]>
Link: https://lore.kernel.org/r/bfc98a38225bbec4158440ad06cb9eee675e3e6f.1568187525.git.lukas@wunner.de
Signed-off-by: Mark Brown <[email protected]>
5 years agodmaengine: bcm2835: Allow cyclic transactions without interrupt
Lukas Wunner [Wed, 11 Sep 2019 10:15:30 +0000 (12:15 +0200)]
dmaengine: bcm2835: Allow cyclic transactions without interrupt

The BCM2835 DMA driver currently requests an interrupt from the
controller regardless whether or not the client has passed in the
DMA_PREP_INTERRUPT flag. This causes unnecessary overhead for cyclic
transactions which do not need an interrupt after each period.

We're about to add such a use case, namely cyclic clearing of the SPI
controller's RX FIFO, so amend the DMA driver to request an interrupt
only if DMA_PREP_INTERRUPT was passed in. Ignore the period_len for
such transactions and set it to the buffer length to make the driver's
calculations work.

Tested-by: Nuno Sá <[email protected]>
Tested-by: Noralf Trønnes <[email protected]>
Signed-off-by: Lukas Wunner <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Acked-by: Stefan Wahren <[email protected]>
Acked-by: Martin Sperl <[email protected]>
Cc: Florian Kauer <[email protected]>
Link: https://lore.kernel.org/r/73cf37be56eb4cbe6f696057c719f3a38cbaf26e.1568187525.git.lukas@wunner.de
Signed-off-by: Mark Brown <[email protected]>
5 years agospi: bcm2835: Drop dma_pending flag
Lukas Wunner [Wed, 11 Sep 2019 10:15:30 +0000 (12:15 +0200)]
spi: bcm2835: Drop dma_pending flag

The BCM2835 SPI driver uses a flag to keep track of whether a DMA
transfer is in progress.

The flag is used to avoid terminating DMA channels multiple times if a
transfer finishes orderly while simultaneously the SPI core invokes the
->handle_err() callback because the transfer took too long.  However
terminating DMA channels multiple times is perfectly fine, so the flag
is unnecessary for this particular purpose.

The flag is also used to avoid invoking bcm2835_spi_undo_prologue()
multiple times under this race condition.  However multiple *concurrent*
invocations can no longer happen since commit 2527704d8411 ("spi:
bcm2835: Synchronize with callback on DMA termination") because the
->handle_err() callback now uses the _sync() variant when terminating
DMA channels.

The only raison d'être of the flag is therefore that
bcm2835_spi_undo_prologue() cannot cope with multiple *sequential*
invocations.  Achieve that by setting tx_prologue to 0 at the end of
the function.  Subsequent invocations thus become no-ops.

With that, the dma_pending flag becomes unnecessary, so drop it.

Tested-by: Nuno Sá <[email protected]>
Tested-by: Noralf Trønnes <[email protected]>
Signed-off-by: Lukas Wunner <[email protected]>
Acked-by: Stefan Wahren <[email protected]>
Acked-by: Martin Sperl <[email protected]>
Link: https://lore.kernel.org/r/062b03b7f86af77a13ce0ec3b22e0bdbfcfba10d.1568187525.git.lukas@wunner.de
Signed-off-by: Mark Brown <[email protected]>
5 years agomlx4: fix spelling mistake "veify" -> "verify"
Colin Ian King [Wed, 11 Sep 2019 14:18:11 +0000 (15:18 +0100)]
mlx4: fix spelling mistake "veify" -> "verify"

There is a spelling mistake in a mlx4_err error message. Fix it.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: hns3: fix spelling mistake "undeflow" -> "underflow"
Colin Ian King [Wed, 11 Sep 2019 14:08:16 +0000 (15:08 +0100)]
net: hns3: fix spelling mistake "undeflow" -> "underflow"

There is a spelling mistake in a .msg literal string. Fix it.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: lmc: fix spelling mistake "runnin" -> "running"
Colin Ian King [Wed, 11 Sep 2019 11:37:34 +0000 (12:37 +0100)]
net: lmc: fix spelling mistake "runnin" -> "running"

There is a spelling mistake in the lmc_trace message. Fix it.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agoNFC: st95hf: fix spelling mistake "receieve" -> "receive"
Colin Ian King [Wed, 11 Sep 2019 10:38:48 +0000 (11:38 +0100)]
NFC: st95hf: fix spelling mistake "receieve" -> "receive"

There is a spelling mistake in a dev_err message. Fix it.

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet/rds: An rds_sock is added too early to the hash table
Ka-Cheong Poon [Wed, 11 Sep 2019 09:58:05 +0000 (02:58 -0700)]
net/rds: An rds_sock is added too early to the hash table

In rds_bind(), an rds_sock is added to the RDS bind hash table before
rs_transport is set.  This means that the socket can be found by the
receive code path when rs_transport is NULL.  And the receive code
path de-references rs_transport for congestion update check.  This can
cause a panic.  An rds_sock should not be added to the bind hash table
before all the needed fields are set.

Reported-by: [email protected]
Signed-off-by: Ka-Cheong Poon <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agomac80211: Do not send Layer 2 Update frame before authorization
Jouni Malinen [Wed, 11 Sep 2019 13:03:05 +0000 (16:03 +0300)]
mac80211: Do not send Layer 2 Update frame before authorization

The Layer 2 Update frame is used to update bridges when a station roams
to another AP even if that STA does not transmit any frames after the
reassociation. This behavior was described in IEEE Std 802.11F-2003 as
something that would happen based on MLME-ASSOCIATE.indication, i.e.,
before completing 4-way handshake. However, this IEEE trial-use
recommended practice document was published before RSN (IEEE Std
802.11i-2004) and as such, did not consider RSN use cases. Furthermore,
IEEE Std 802.11F-2003 was withdrawn in 2006 and as such, has not been
maintained amd should not be used anymore.

Sending out the Layer 2 Update frame immediately after association is
fine for open networks (and also when using SAE, FT protocol, or FILS
authentication when the station is actually authenticated by the time
association completes). However, it is not appropriate for cases where
RSN is used with PSK or EAP authentication since the station is actually
fully authenticated only once the 4-way handshake completes after
authentication and attackers might be able to use the unauthenticated
triggering of Layer 2 Update frame transmission to disrupt bridge
behavior.

Fix this by postponing transmission of the Layer 2 Update frame from
station entry addition to the point when the station entry is marked
authorized. Similarly, send out the VLAN binding update only if the STA
entry has already been authorized.

Signed-off-by: Jouni Malinen <[email protected]>
Reviewed-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agoRevert "mmc: sdhci: Remove unneeded quirk2 flag of O2 SD host controller"
Daniel Drake [Thu, 5 Sep 2019 04:55:57 +0000 (12:55 +0800)]
Revert "mmc: sdhci: Remove unneeded quirk2 flag of O2 SD host controller"

This reverts commit 414126f9e5abf1973c661d24229543a9458fa8ce.

This commit broke eMMC storage access on a new consumer MiniPC based on
AMD SoC, which has eMMC connected to:

02:00.0 SD Host controller: O2 Micro, Inc. Device 8620 (rev 01) (prog-if 01)
Subsystem: O2 Micro, Inc. Device 0002

During probe, several errors are seen including:

  mmc1: Got data interrupt 0x02000000 even though no data operation was in progress.
  mmc1: Timeout waiting for hardware interrupt.
  mmc1: error -110 whilst initialising MMC card

Reverting this commit allows the eMMC storage to be detected & usable
again.

Signed-off-by: Daniel Drake <[email protected]>
Fixes: 414126f9e5ab ("mmc: sdhci: Remove unneeded quirk2 flag of O2 SD host
controller")
Cc: [email protected] # v5.1+
Signed-off-by: Ulf Hansson <[email protected]>
5 years agoRevert "mmc: bcm2835: Terminate timeout work synchronously"
Stefan Wahren [Sun, 8 Sep 2019 07:45:52 +0000 (09:45 +0200)]
Revert "mmc: bcm2835: Terminate timeout work synchronously"

The commit 37fefadee8bb ("mmc: bcm2835: Terminate timeout work
synchronously") causes lockups in case of hardware timeouts due the
timeout work also calling cancel_delayed_work_sync() on its own.
So revert it.

Fixes: 37fefadee8bb ("mmc: bcm2835: Terminate timeout work synchronously")
Cc: [email protected]
Signed-off-by: Stefan Wahren <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
5 years agogpio: creg-snps: use devm_platform_ioremap_resource() to simplify code
YueHaibing [Fri, 6 Sep 2019 13:10:32 +0000 (21:10 +0800)]
gpio: creg-snps: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Signed-off-by: YueHaibing <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Eugeniy Paltsev <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
5 years agogpio: devres: Switch to EXPORT_SYMBOL_GPL()
Geert Uytterhoeven [Fri, 6 Sep 2019 08:45:39 +0000 (10:45 +0200)]
gpio: devres: Switch to EXPORT_SYMBOL_GPL()

Change all exported symbols for managed GPIO functions from
EXPORT_SYMBOL() to EXPORT_SYMBOL_GPL(), like is used for their
non-managed counterparts.

Signed-off-by: Geert Uytterhoeven <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
5 years agogpio: of: Switch to EXPORT_SYMBOL_GPL()
Geert Uytterhoeven [Fri, 6 Sep 2019 08:45:38 +0000 (10:45 +0200)]
gpio: of: Switch to EXPORT_SYMBOL_GPL()

All exported functions provide genuine Linux-specific functionality.

Signed-off-by: Geert Uytterhoeven <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
5 years agogpio: of: Make of_gpio_simple_xlate() private
Geert Uytterhoeven [Fri, 6 Sep 2019 08:45:37 +0000 (10:45 +0200)]
gpio: of: Make of_gpio_simple_xlate() private

Since commit 9a95e8d25a140ba9 ("gpio: remove etraxfs driver"), there are
no more users of of_gpio_simple_xlate() outside gpiolib-of.c.
All GPIO drivers that need it now rely on of_gpiochip_add() setting it
up as the default translate function.

Signed-off-by: Geert Uytterhoeven <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
5 years agogpio: of: Make of_get_named_gpiod_flags() private
Geert Uytterhoeven [Fri, 6 Sep 2019 08:45:36 +0000 (10:45 +0200)]
gpio: of: Make of_get_named_gpiod_flags() private

Since commit f626d6dfb7098525 ("gpio: of: Break out OF-only code"),
there are no more users of of_get_named_gpiod_flags() outside
gpiolib-of.c.

Signed-off-by: Geert Uytterhoeven <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
5 years agoMerge branches 'arm/omap', 'arm/exynos', 'arm/smmu', 'arm/mediatek', 'arm/qcom',...
Joerg Roedel [Wed, 11 Sep 2019 10:39:19 +0000 (12:39 +0200)]
Merge branches 'arm/omap', 'arm/exynos', 'arm/smmu', 'arm/mediatek', 'arm/qcom', 'arm/renesas', 'x86/amd', 'x86/vt-d' and 'core' into next

5 years agoiommu/vt-d: Declare Broadwell igfx dmar support snafu
Chris Wilson [Mon, 9 Sep 2019 11:00:10 +0000 (12:00 +0100)]
iommu/vt-d: Declare Broadwell igfx dmar support snafu

Despite the widespread and complete failure of Broadwell integrated
graphics when DMAR is enabled, known over the years, we have never been
able to root cause the issue. Instead, we let the failure undermine our
confidence in the iommu system itself when we should be pushing for it to
be always enabled. Quirk away Broadwell and remove the rotten apple.

References: https://bugs.freedesktop.org/show_bug.cgi?id=89360
Signed-off-by: Chris Wilson <[email protected]>
Cc: Lu Baolu <[email protected]>
Cc: Martin Peres <[email protected]>
Cc: Joerg Roedel <[email protected]>
Reviewed-by: Lu Baolu <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
5 years agoiommu/vt-d: Add Scalable Mode fault information
Kyung Min Park [Fri, 6 Sep 2019 18:14:02 +0000 (11:14 -0700)]
iommu/vt-d: Add Scalable Mode fault information

Intel VT-d specification revision 3 added support for Scalable Mode
Translation for DMA remapping. Add the Scalable Mode fault reasons to
show detailed fault reasons when the translation fault happens.

Link: https://software.intel.com/sites/default/files/managed/c5/15/vt-directed-io-spec.pdf
Reviewed-by: Sohil Mehta <[email protected]>
Signed-off-by: Kyung Min Park <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
5 years agoiommu/vt-d: Use bounce buffer for untrusted devices
Lu Baolu [Fri, 6 Sep 2019 06:14:52 +0000 (14:14 +0800)]
iommu/vt-d: Use bounce buffer for untrusted devices

The Intel VT-d hardware uses paging for DMA remapping.
The minimum mapped window is a page size. The device
drivers may map buffers not filling the whole IOMMU
window. This allows the device to access to possibly
unrelated memory and a malicious device could exploit
this to perform DMA attacks. To address this, the
Intel IOMMU driver will use bounce pages for those
buffers which don't fill whole IOMMU pages.

Cc: Ashok Raj <[email protected]>
Cc: Jacob Pan <[email protected]>
Cc: Kevin Tian <[email protected]>
Signed-off-by: Lu Baolu <[email protected]>
Tested-by: Xu Pengfei <[email protected]>
Tested-by: Mika Westerberg <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
5 years agoiommu/vt-d: Add trace events for device dma map/unmap
Lu Baolu [Fri, 6 Sep 2019 06:14:51 +0000 (14:14 +0800)]
iommu/vt-d: Add trace events for device dma map/unmap

This adds trace support for the Intel IOMMU driver. It
also declares some events which could be used to trace
the events when an IOVA is being mapped or unmapped in
a domain.

Cc: Ashok Raj <[email protected]>
Cc: Jacob Pan <[email protected]>
Cc: Kevin Tian <[email protected]>
Signed-off-by: Mika Westerberg <[email protected]>
Signed-off-by: Lu Baolu <[email protected]>
Reviewed-by: Steven Rostedt (VMware) <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
5 years agoiommu/vt-d: Don't switch off swiotlb if bounce page is used
Lu Baolu [Fri, 6 Sep 2019 06:14:50 +0000 (14:14 +0800)]
iommu/vt-d: Don't switch off swiotlb if bounce page is used

The bounce page implementation depends on swiotlb. Hence, don't
switch off swiotlb if the system has untrusted devices or could
potentially be hot-added with any untrusted devices.

Cc: Ashok Raj <[email protected]>
Cc: Jacob Pan <[email protected]>
Cc: Kevin Tian <[email protected]>
Signed-off-by: Lu Baolu <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
5 years agoiommu/vt-d: Check whether device requires bounce buffer
Lu Baolu [Fri, 6 Sep 2019 06:14:49 +0000 (14:14 +0800)]
iommu/vt-d: Check whether device requires bounce buffer

This adds a helper to check whether a device needs to
use bounce buffer. It also provides a boot time option
to disable the bounce buffer. Users can use this to
prevent the iommu driver from using the bounce buffer
for performance gain.

Cc: Ashok Raj <[email protected]>
Cc: Jacob Pan <[email protected]>
Cc: Kevin Tian <[email protected]>
Signed-off-by: Lu Baolu <[email protected]>
Tested-by: Xu Pengfei <[email protected]>
Tested-by: Mika Westerberg <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
5 years agoswiotlb: Split size parameter to map/unmap APIs
Lu Baolu [Fri, 6 Sep 2019 06:14:48 +0000 (14:14 +0800)]
swiotlb: Split size parameter to map/unmap APIs

This splits the size parameter to swiotlb_tbl_map_single() and
swiotlb_tbl_unmap_single() into an alloc_size and a mapping_size
parameter, where the latter one is rounded up to the iommu page
size.

Suggested-by: Christoph Hellwig <[email protected]>
Signed-off-by: Lu Baolu <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Joerg Roedel <[email protected]>
5 years agoregulator: core: Fix error return for /sys access
H. Nikolaus Schaller [Tue, 10 Sep 2019 19:22:29 +0000 (21:22 +0200)]
regulator: core: Fix error return for /sys access

regulator_uV_show() is missing error handling if regulator_get_voltage_rdev()
returns negative values. Instead it prints the errno as a string, e.g. -EINVAL
as "-22" which could be interpreted as -22 µV.

We also do not need to hold the lock while converting the integer to a string.

Reported-by: Adam Ford <[email protected]>
Signed-off-by: H. Nikolaus Schaller <[email protected]>
Tested-by: Adam Ford <[email protected]>
Link: https://lore.kernel.org/r/f37f2a1276efcb34cf3b7f1a25481175be048806.1568143348.git.hns@goldelico.com
Signed-off-by: Mark Brown <[email protected]>
5 years agoregulator: da9211: fix obtaining "enable" GPIO
Dmitry Torokhov [Tue, 10 Sep 2019 17:02:46 +0000 (10:02 -0700)]
regulator: da9211: fix obtaining "enable" GPIO

This fixes 11da04af0d3b, as devm_gpiod_get_from_of_node() does
not do translation "con-id" -> "con-id-gpios" that our bindings expects,
and therefore it was wrong to change connection ID to be simply "enable"
when moving to using devm_gpiod_get_from_of_node().

Fixes: 11da04af0d3b ("regulator: da9211: Pass descriptors instead of GPIO numbers")
Signed-off-by: Dmitry Torokhov <[email protected]>
Link: https://lore.kernel.org/r/20190910170246.GA56792@dtor-ws
Signed-off-by: Mark Brown <[email protected]>
5 years agoregulator: max77686: fix obtaining "maxim,ena" GPIO
Dmitry Torokhov [Tue, 10 Sep 2019 17:00:50 +0000 (10:00 -0700)]
regulator: max77686: fix obtaining "maxim,ena" GPIO

This fixes 96392c3d8ca4, as devm_gpiod_get_from_of_node() does
not do translation "con-id" -> "con-id-gpios" that our bindings expects,
and therefore it was wrong to change connection ID to be simply
"maxim,ena" when moving to using devm_gpiod_get_from_of_node().

Fixes: 96392c3d8ca4 ("regulator: max77686: Pass descriptor instead of GPIO number")
Signed-off-by: Dmitry Torokhov <[email protected]>
Link: https://lore.kernel.org/r/20190910170050.GA55530@dtor-ws
Signed-off-by: Mark Brown <[email protected]>
5 years agogpio: aspeed: Add in ast2600 details to Aspeed driver
Rashmica Gupta [Fri, 6 Sep 2019 06:37:37 +0000 (16:37 +1000)]
gpio: aspeed: Add in ast2600 details to Aspeed driver

The ast2600 is a new generation of SoC from ASPEED. Similarly to the
ast2400 and ast2500, it has a GPIO controller for it's 3.3V GPIO pins.
Additionally, it has a GPIO controller for 1.8V GPIO pins.

As the register names for both controllers are the same and the 36 1.8V
GPIOs and the first 36 of the 3.3V GPIOs are all bidirectional, we can
use the same configuration struct and use the ngpio property to
differentiate between the two sets of GPIOs.

Signed-off-by: Rashmica Gupta <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
5 years agogpio: aspeed: Use ngpio property from device tree if available
Rashmica Gupta [Fri, 6 Sep 2019 06:27:26 +0000 (16:27 +1000)]
gpio: aspeed: Use ngpio property from device tree if available

Use the ngpio property from the device tree if it exists. If it doesn't
then fallback to the hardcoded value in the config.

This is in preparation for adding ast2600 support. The ast2600 SoC has
two GPIO controllers and so requires two instances of the GPIO driver.
We use the ngpio property to different between them as they have
different numbers of GPIOs.

Signed-off-by: Rashmica Gupta <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Joel Stanley <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
5 years agogpio: aspeed: Setup irqchip dynamically
Rashmica Gupta [Fri, 6 Sep 2019 06:26:44 +0000 (16:26 +1000)]
gpio: aspeed: Setup irqchip dynamically

This is in preparation for adding ast2600 support. The ast2600 SoC
requires two instances of the GPIO driver as it has two GPIO
controllers. Each instance needs it's own irqchip.

Signed-off-by: Rashmica Gupta <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Joel Stanley <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
5 years agogpio/aspeed: Fix incorrect number of banks
Rashmica Gupta [Fri, 6 Sep 2019 06:26:22 +0000 (16:26 +1000)]
gpio/aspeed: Fix incorrect number of banks

The current calculation for the number of GPIO banks is only correct if
the number of GPIOs is a multiple of 32 (if there were 31 GPIOs we would
currently say there are 0 banks, which is incorrect).

Fixes: 361b79119a4b7 ('gpio: Add Aspeed driver')
Signed-off-by: Rashmica Gupta <[email protected]>
Reviewed-by: Andrew Jeffery <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Joel Stanley <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
5 years agogpio: aspeed: Update documentation with ast2600 controllers
Rashmica Gupta [Fri, 6 Sep 2019 06:25:47 +0000 (16:25 +1000)]
gpio: aspeed: Update documentation with ast2600 controllers

The ast2600 is a new generation of SoC from ASPEED. Similarly to the
ast2400 and ast2500, it has a GPIO controller for it's 3.3V GPIO pins.
Additionally, it has a GPIO controller for 36 1.8V GPIO pins.  We use
the ngpio property to differentiate between these controllers.

Signed-off-by: Rashmica Gupta <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
5 years agogpiolib: acpi: Add gpiolib_acpi_run_edge_events_on_boot option and blacklist
Hans de Goede [Tue, 27 Aug 2019 20:28:35 +0000 (22:28 +0200)]
gpiolib: acpi: Add gpiolib_acpi_run_edge_events_on_boot option and blacklist

Another day; another DSDT bug we need to workaround...

Since commit ca876c7483b6 ("gpiolib-acpi: make sure we trigger edge events
at least once on boot") we call _AEI edge handlers at boot.

In some rare cases this causes problems. One example of this is the Minix
Neo Z83-4 mini PC, this device has a clear DSDT bug where it has some copy
and pasted code for dealing with Micro USB-B connector host/device role
switching, while the mini PC does not even have a micro-USB connector.
This code, which should not be there, messes with the DDC data pin from
the HDMI connector (switching it to GPIO mode) breaking HDMI support.

To avoid problems like this, this commit adds a new
gpiolib_acpi.run_edge_events_on_boot kernel commandline option, which
allows disabling the running of _AEI edge event handlers at boot.

The default value is -1/auto which uses a DMI based blacklist, the initial
version of this blacklist contains the Neo Z83-4 fixing the HDMI breakage.

Cc: [email protected]
Cc: Daniel Drake <[email protected]>
Cc: Ian W MORRISON <[email protected]>
Reported-by: Ian W MORRISON <[email protected]>
Suggested-by: Ian W MORRISON <[email protected]>
Fixes: ca876c7483b6 ("gpiolib-acpi: make sure we trigger edge events at least once on boot")
Signed-off-by: Hans de Goede <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: Mika Westerberg <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Tested-by: Ian W MORRISON <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
5 years agolib/Kconfig: fix OBJAGG in lib/ menu structure
Randy Dunlap [Mon, 9 Sep 2019 21:54:21 +0000 (14:54 -0700)]
lib/Kconfig: fix OBJAGG in lib/ menu structure

Keep the "Library routines" menu intact by moving OBJAGG into it.
Otherwise OBJAGG is displayed/presented as an orphan in the
various config menus.

Fixes: 0a020d416d0a ("lib: introduce initial implementation of object aggregation manager")
Signed-off-by: Randy Dunlap <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Ido Schimmel <[email protected]>
Cc: David S. Miller <[email protected]>
Tested-by: Ido Schimmel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet: sonic: replace dev_kfree_skb in sonic_send_packet
Mao Wenan [Wed, 11 Sep 2019 01:36:23 +0000 (09:36 +0800)]
net: sonic: replace dev_kfree_skb in sonic_send_packet

sonic_send_packet will be processed in irq or non-irq
context, so it would better use dev_kfree_skb_any
instead of dev_kfree_skb.

Fixes: d9fb9f384292 ("*sonic/natsemi/ns83829: Move the National Semi-conductor drivers")
Signed-off-by: Mao Wenan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agowimax: i2400: fix memory leak
Navid Emamdoost [Tue, 10 Sep 2019 23:01:40 +0000 (18:01 -0500)]
wimax: i2400: fix memory leak

In i2400m_op_rfkill_sw_toggle cmd buffer should be released along with
skb response.

Signed-off-by: Navid Emamdoost <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agogpio: Initialize the irqchip valid_mask with a callback
Linus Walleij [Wed, 4 Sep 2019 14:01:04 +0000 (16:01 +0200)]
gpio: Initialize the irqchip valid_mask with a callback

After changing the valid_mask for the struct gpio_chip
to detect the need and presence of a valid mask with the
presence of a .init_valid_mask() callback to fill it in,
we augment the gpio_irq_chip to use the same logic.

Switch all driver using the gpio_irq_chio valid_mask
over to this new method.

This makes sure the valid_mask for the gpio_irq_chip gets
filled in when we add the gpio_chip, which makes it a
little easier to switch over drivers using the old
way of setting up gpio_irq_chip over to the new method
of passing the gpio_irq_chip along with the gpio_chip.
(See drivers/gpio/TODO for details.)

Cc: Joel Stanley <[email protected]>
Cc: Thierry Reding <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Tested-by: Hans de Goede <[email protected]>
Reviewed-by: Andrew Jeffery <[email protected]>
Acked-by: Mika Westerberg <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Reviewed-by: Patrice Chotard <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
5 years agohwmon: (shtc1) add support for the SHTC3 sensor
Dan Robertson [Thu, 5 Sep 2019 01:45:53 +0000 (01:45 +0000)]
hwmon: (shtc1) add support for the SHTC3 sensor

Add support for the Sensirion SHTC3 humidity and temperature sensor to
the shtc1 module.

Signed-off-by: Dan Robertson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
5 years agohwmon: (shtc1) fix shtc1 and shtw1 id mask
Dan Robertson [Thu, 5 Sep 2019 01:45:54 +0000 (01:45 +0000)]
hwmon: (shtc1) fix shtc1 and shtw1 id mask

Fix an error in the bitmaskfor the shtc1 and shtw1 bitmask used to
retrieve the chip ID from the ID register. See section 5.7 of the shtw1
or shtc1 datasheet for details.

Fixes: 1a539d372edd9832444e7a3daa710c444c014dc9 ("hwmon: add support for Sensirion SHTC1 sensor")
Signed-off-by: Dan Robertson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[groeck: Reordered to be first in series and adjusted accordingly]
Signed-off-by: Guenter Roeck <[email protected]>
5 years agosctp: fix the missing put_user when dumping transport thresholds
Xin Long [Mon, 9 Sep 2019 07:33:29 +0000 (15:33 +0800)]
sctp: fix the missing put_user when dumping transport thresholds

This issue causes SCTP_PEER_ADDR_THLDS sockopt not to be able to dump
a transport thresholds info.

Fix it by adding 'goto' put_user in sctp_getsockopt_paddr_thresholds.

Fixes: 8add543e369d ("sctp: add SCTP_FUTURE_ASSOC for SCTP_PEER_ADDR_THLDS sockopt")
Signed-off-by: Xin Long <[email protected]>
Acked-by: Marcelo Ricardo Leitner <[email protected]>
Acked-by: Neil Horman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agosch_hhf: ensure quantum and hhf_non_hh_weight are non-zero
Cong Wang [Sun, 8 Sep 2019 20:40:51 +0000 (13:40 -0700)]
sch_hhf: ensure quantum and hhf_non_hh_weight are non-zero

In case of TCA_HHF_NON_HH_WEIGHT or TCA_HHF_QUANTUM is zero,
it would make no progress inside the loop in hhf_dequeue() thus
kernel would get stuck.

Fix this by checking this corner case in hhf_change().

Fixes: 10239edf86f1 ("net-qdisc-hhf: Heavy-Hitter Filter (HHF) qdisc")
Reported-by: [email protected]
Reported-by: [email protected]
Reported-by: [email protected]
Cc: Jamal Hadi Salim <[email protected]>
Cc: Jiri Pirko <[email protected]>
Cc: Terry Lam <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet_sched: check cops->tcf_block in tc_bind_tclass()
Cong Wang [Sun, 8 Sep 2019 19:11:23 +0000 (12:11 -0700)]
net_sched: check cops->tcf_block in tc_bind_tclass()

At least sch_red and sch_tbf don't implement ->tcf_block()
while still have a non-zero tc "class".

Instead of adding nop implementations to each of such qdisc's,
we can just relax the check of cops->tcf_block() in
tc_bind_tclass(). They don't support TC filter anyway.

Reported-by: [email protected]
Cc: Jamal Hadi Salim <[email protected]>
Cc: Jiri Pirko <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agowaitid: Add support for waiting for the current process group
Eric W. Biederman [Tue, 23 Jul 2019 12:44:46 +0000 (07:44 -0500)]
waitid: Add support for waiting for the current process group

It was recently discovered that the linux version of waitid is not a
superset of the other wait functions because it does not include support
for waiting for the current process group. This has two downsides:
1. An extra system call is needed to get the current process group.
2. After the current process group is received and before it is passed
   to waitid a signal could arrive causing the current process group to change.
   Inherent race-conditions as these make it impossible for userspace to
   emulate this functionaly and thus violate async-signal safety
   requirements for waitpid.

Arguments can be made for using a different choice of idtype and id
for this case but the BSDs already use this P_PGID and 0 to indicate
waiting for the current process's process group.  So be nice to user
space programmers and don't introduce an unnecessary incompatibility.

Some people have noted that the posix description is that
waitpid will wait for the current process group, and that in
the presence of pthreads that process group can change.  To get
clarity on this issue I looked at XNU, FreeBSD, and Luminos.  All of
those flavors of unix waited for the current process group at the
time of call and as written could not adapt to the process group
changing after the call.

At one point Linux did adapt to the current process group changing but
that stopped in 161550d74c07 ("pid: sys_wait... fixes").  It has been
over 11 years since Linux has that behavior, no programs that fail
with the change in behavior have been reported, and I could not
find any other unix that does this.  So I think it is safe to clarify
the definition of current process group, to current process group
at the time of the wait function.

Signed-off-by: "Eric W. Biederman" <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
Reviewed-by: Oleg Nesterov <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Rich Felker <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Zong Li <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Florian Weimer <[email protected]>
Cc: Adhemerval Zanella <[email protected]>
Cc: GNU C Library <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
5 years agoMerge tag 'ipc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic
Linus Torvalds [Tue, 10 Sep 2019 11:34:13 +0000 (12:34 +0100)]
Merge tag 'ipc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic

Pull ipc regression fixes from Arnd Bergmann:
 "Fix ipc regressions from y2038 patches

  These are two regression fixes for bugs that got introduced during the
  system call rework that went into linux-5.1 but only bisected and
  fixed now:

   - One patch affects semtimedop() on many of the less common 32-bit
     architectures, this just needs a single-line bugfix.

   - The other affects only sparc64 and has a slightly more invasive
     workaround to apply the same change to sparc64 that was done to the
     generic code used everywhere else"

* tag 'ipc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
  ipc: fix sparc64 ipc() wrapper
  ipc: fix semtimedop for generic 32-bit architectures

5 years agoplatform/x86: asus-wmi: Refactor charge threshold to use the battery hooking API
Kristian Klausen [Mon, 9 Sep 2019 17:31:28 +0000 (19:31 +0200)]
platform/x86: asus-wmi: Refactor charge threshold to use the battery hooking API

At the same time use the official naming for the knobs.

Tested on a Zenbook UX430UNR.

Signed-off-by: Kristian Klausen <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
5 years agogpiolib: acpi: make acpi_can_fallback_to_crs() static
Dmitry Torokhov [Wed, 4 Sep 2019 17:26:24 +0000 (10:26 -0700)]
gpiolib: acpi: make acpi_can_fallback_to_crs() static

It is not used outside gpiolib-acpi.c module, so there is no need to
export it.

Signed-off-by: Dmitry Torokhov <[email protected]>
Link: https://lore.kernel.org/r/20190904172624.GA76617@dtor-ws
Reviewed-by: Andy Shevchenko <[email protected]>
Acked-by: Mika Westerberg <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
5 years agogpiolib: of: fix fallback quirks handling
Dmitry Torokhov [Tue, 3 Sep 2019 23:18:56 +0000 (16:18 -0700)]
gpiolib: of: fix fallback quirks handling

We should only try to execute fallback quirks handling when previous
call returned -ENOENT, and not when we did not get -EPROBE_DEFER.
The other errors should be treated as hard errors: we did find the GPIO
description, but for some reason we failed to handle it properly.

The fallbacks should only be executed when previous handlers returned
-ENOENT, which means the mapping/description was not found.

Also let's remove the explicit deferral handling when iterating through
GPIO suffixes: it is not needed anymore as we will not be calling
fallbacks for anything but -ENOENT.

Fixes: df451f83e1fc ("gpio: of: fix Freescale SPI CS quirk handling")
Signed-off-by: Dmitry Torokhov <[email protected]>
Link: https://lore.kernel.org/r/20190903231856.GA165165@dtor-ws
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
5 years agospi: bcm2835: Work around DONE bit erratum
Lukas Wunner [Sat, 3 Aug 2019 10:10:00 +0000 (12:10 +0200)]
spi: bcm2835: Work around DONE bit erratum

Commit 3bd7f6589f67 ("spi: bcm2835: Overcome sglist entry length
limitation") amended the BCM2835 SPI driver with support for DMA
transfers whose buffers are not aligned to 4 bytes and require more than
one sglist entry.

When testing this feature with upcoming commits to speed up TX-only and
RX-only transfers, I noticed that SPI transmission sometimes breaks.
A function introduced by the commit, bcm2835_spi_transfer_prologue(),
performs one or two PIO transmissions as a prologue to the actual DMA
transmission.  It turns out that the breakage goes away if the DONE bit
in the CS register is set when ending such a PIO transmission.

The DONE bit signifies emptiness of the TX FIFO.  According to the spec,
the bit is of type RO, so writing it should never have any effect.
Perhaps the spec is wrong and the bit is actually of type RW1C.
E.g. the I2C controller on the BCM2835 does have an RW1C DONE bit which
needs to be cleared by the driver.  Another, possibly more likely
explanation is that it's a hardware erratum since the issue does not
occur consistently.

Either way, amend bcm2835_spi_transfer_prologue() to always write the
DONE bit.

Usually a transmission is ended by bcm2835_spi_reset_hw().  If the
transmission was successful, the TX FIFO is empty and thus the DONE bit
is set when bcm2835_spi_reset_hw() reads the CS register.  The bit is
then written back to the register, so we happen to do the right thing.

However if DONE is not set, e.g. because transmission is aborted with
a non-empty TX FIFO, the bit won't be written by bcm2835_spi_reset_hw()
and it seems possible that transmission might subsequently break.  To be
on the safe side, likewise amend bcm2835_spi_reset_hw() to always write
the bit.

Tested-by: Nuno Sá <[email protected]>
Signed-off-by: Lukas Wunner <[email protected]>
Acked-by: Stefan Wahren <[email protected]>
Acked-by: Martin Sperl <[email protected]>
Link: https://lore.kernel.org/r/edb004dff4af6106f6bfcb89e1a96391e96eb857.1564825752.git.lukas@wunner.de
Signed-off-by: Mark Brown <[email protected]>
5 years agoMerge tag 'gpio-v5.4-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Walleij [Tue, 10 Sep 2019 10:12:04 +0000 (11:12 +0100)]
Merge tag 'gpio-v5.4-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into fixes

gpio: fixes for v5.4

- fix a memory leak in gpio-mockup
- fix two flag validation bugs in gpiolib's character device ioctl()'s

5 years agoMerge tag 'intel-gpio-v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy...
Linus Walleij [Tue, 10 Sep 2019 10:10:01 +0000 (11:10 +0100)]
Merge tag 'intel-gpio-v5.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into devel

intel-gpio for v5.4-1

The clean up of IRQ chip initialization has been done in few drivers.
Stale record in MAINTAINERS database is removed.

The following is an automated git shortlog grouped by driver:

intel-mid:
 -  Pass irqchip when adding gpiochip
 -  MAINTAINERS: Remove stale record for gpio-intel-mid.c

lynxpoint:
 -  Pass irqchip when adding gpiochip

merrifield:
 -  Pass irqchip when adding gpiochip

pch:
 -  Use dev_get_drvdata

5 years agoregulator: uniphier: Add Pro5 USB3 VBUS support
Kunihiko Hayashi [Tue, 10 Sep 2019 01:51:44 +0000 (10:51 +0900)]
regulator: uniphier: Add Pro5 USB3 VBUS support

Pro5 SoC has same scheme of USB3 VBUS as Pro4, so the data for Pro5 is
equivalent to Pro4.

Signed-off-by: Kunihiko Hayashi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
5 years agodt-bindings: regulator: add regulator-fixed-clock binding
Philippe Schenker [Tue, 10 Sep 2019 06:21:19 +0000 (06:21 +0000)]
dt-bindings: regulator: add regulator-fixed-clock binding

This adds the documentation to the compatible regulator-fixed-clock.
This binding is a special binding of regulator-fixed and adds the
ability to add a clock to regulator-fixed, so the regulator can be
enabled and disabled with that clock. If the special compatible
regulator-fixed-clock is used it is mandatory to supply a clock.

Signed-off-by: Philippe Schenker <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
5 years agoregulator: fixed: add possibility to enable by clock
Philippe Schenker [Tue, 10 Sep 2019 06:21:15 +0000 (06:21 +0000)]
regulator: fixed: add possibility to enable by clock

This commit adds the possibility to choose the compatible
"regulator-fixed-clock" in devicetree.

This is a special regulator-fixed that has to have a clock, from which
the regulator gets switched on and off.

Signed-off-by: Philippe Schenker <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
5 years agoregulator: s2mps11: Consistently use local variable
Krzysztof Kozlowski [Mon, 9 Sep 2019 15:57:23 +0000 (17:57 +0200)]
regulator: s2mps11: Consistently use local variable

The value under 's2mps11->ext_control_gpiod[i]' is assigned to local
variable and used in probe in one place before.  Use it consistently
later so code will be easier to read.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
5 years agobridge/mdb: remove wrong use of NLM_F_MULTI
Nicolas Dichtel [Fri, 6 Sep 2019 09:47:02 +0000 (11:47 +0200)]
bridge/mdb: remove wrong use of NLM_F_MULTI

NLM_F_MULTI must be used only when a NLMSG_DONE message is sent at the end.
In fact, NLMSG_DONE is sent only at the end of a dump.

Libraries like libnl will wait forever for NLMSG_DONE.

Fixes: 949f1e39a617 ("bridge: mdb: notify on router port add and del")
CC: Nikolay Aleksandrov <[email protected]>
Signed-off-by: Nicolas Dichtel <[email protected]>
Acked-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agonet/ibmvnic: Fix missing { in __ibmvnic_reset
Michal Suchanek [Mon, 9 Sep 2019 20:44:51 +0000 (22:44 +0200)]
net/ibmvnic: Fix missing { in __ibmvnic_reset

Commit 1c2977c09499 ("net/ibmvnic: free reset work of removed device from queue")
adds a } without corresponding { causing build break.

Fixes: 1c2977c09499 ("net/ibmvnic: free reset work of removed device from queue")
Signed-off-by: Michal Suchanek <[email protected]>
Reviewed-by: Tyrel Datwyler <[email protected]>
Reviewed-by: Juliet Kim <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
5 years agoobjtool: Clobber user CFLAGS variable
Josh Poimboeuf [Thu, 29 Aug 2019 23:28:49 +0000 (18:28 -0500)]
objtool: Clobber user CFLAGS variable

If the build user has the CFLAGS variable set in their environment,
objtool blindly appends to it, which can cause unexpected behavior.

Clobber CFLAGS to ensure consistent objtool compilation behavior.

Reported-by: Valdis Kletnieks <[email protected]>
Tested-by: Valdis Kletnieks <[email protected]>
Signed-off-by: Josh Poimboeuf <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: https://lkml.kernel.org/r/83a276df209962e6058fcb6c615eef9d401c21bc.1567121311.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <[email protected]>
5 years agox86/umip: Add emulation (spoofing) for UMIP covered instructions in 64-bit processes...
Brendan Shanks [Thu, 5 Sep 2019 23:22:21 +0000 (16:22 -0700)]
x86/umip: Add emulation (spoofing) for UMIP covered instructions in 64-bit processes as well

Add emulation (spoofing) of the SGDT, SIDT, and SMSW instructions for 64-bit
processes.

Wine users have encountered a number of 64-bit Windows games that use
these instructions (particularly SGDT), and were crashing when run on
UMIP-enabled systems.

Originally-by: Ricardo Neri <[email protected]>
Signed-off-by: Brendan Shanks <[email protected]>
Reviewed-by: Ricardo Neri <[email protected]>
Reviewed-by: H. Peter Anvin (Intel) <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: Eric W. Biederman <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
[ Minor edits: capitalization, added 'spoofing' wording. ]
Signed-off-by: Ingo Molnar <[email protected]>
5 years agodrm/lima: fix lima_gem_wait() return value
Vasily Khoruzhick [Sun, 8 Sep 2019 02:48:00 +0000 (19:48 -0700)]
drm/lima: fix lima_gem_wait() return value

drm_gem_reservation_object_wait() returns 0 if it succeeds and -ETIME
if it timeouts, but lima driver assumed that 0 is error.

Cc: [email protected]
Fixes: a1d2a6339961e ("drm/lima: driver for ARM Mali4xx GPUs")
Signed-off-by: Vasily Khoruzhick <[email protected]>
Signed-off-by: Qiang Yu <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
5 years agoARM: multi_v5_defconfig: make DaVinci part of the ARM v5 multiplatform build
Bartosz Golaszewski [Thu, 25 Jul 2019 13:12:57 +0000 (15:12 +0200)]
ARM: multi_v5_defconfig: make DaVinci part of the ARM v5 multiplatform build

Add all DaVinci boards to multi_v5_defconfig.

Signed-off-by: Bartosz Golaszewski <[email protected]>
Acked-by: Sekhar Nori <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
5 years agoARM: davinci: support multiplatform build for ARM v5
Bartosz Golaszewski [Thu, 25 Jul 2019 13:12:56 +0000 (15:12 +0200)]
ARM: davinci: support multiplatform build for ARM v5

Add modifications necessary to make davinci part of the ARM v5
multiplatform build.

Move the arch-specific configuration out of arch/arm/Kconfig and
into mach-davinci/Kconfig. Remove the sub-menu for DaVinci
implementations (they'll be visible directly under the system type.
Select all necessary options not already selected by ARCH_MULTI_V5.
Update davinci_all_defconfig. Explicitly include the mach-specific
headers in mach-davinci/Makefile.

Signed-off-by: Bartosz Golaszewski <[email protected]>
Acked-by: Sekhar Nori <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
5 years agoplatform/x86: asus-wmi: Rename CHARGE_THRESHOLD to RSOC
Kristian Klausen [Mon, 9 Sep 2019 17:31:27 +0000 (19:31 +0200)]
platform/x86: asus-wmi: Rename CHARGE_THRESHOLD to RSOC

The device is officially called "Relative state of charge" (RSOC).
At the same time add the missing DEVID from the name.

Signed-off-by: Kristian Klausen <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
5 years agoplatform/x86: asus-wmi: Reorder ASUS_WMI_CHARGE_THRESHOLD
Kristian Klausen [Mon, 9 Sep 2019 17:31:26 +0000 (19:31 +0200)]
platform/x86: asus-wmi: Reorder ASUS_WMI_CHARGE_THRESHOLD

At the same time add a comment explaining what it is used for.

Signed-off-by: Kristian Klausen <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
5 years agoMerge tag 'regulator-fix-v5.3-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 9 Sep 2019 17:58:57 +0000 (10:58 -0700)]
Merge tag 'regulator-fix-v5.3-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
 "This is obviouly very late, containing three small and simple driver
  specific fixes.

  The main one is the TWL fix, this fixes issues with cpufreq on the
  PMICs used with BeagleBoard generation OMAP SoCs which had been broken
  due to changes in the generic OPP code exposing a bug in the regulator
  driver for these devices causing them to think that OPPs weren't
  supported on the system.

  Sorry about sending this so late, I hadn't registered that the TWL
  issue manifested in cpufreq"

* tag 'regulator-fix-v5.3-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: twl: voltage lists for vdd1/2 on twl4030
  regulator: act8945a-regulator: fix ldo register addresses in set_mode hook
  regulator: slg51000: Fix a couple NULL vs IS_ERR() checks

5 years agovirtio_ring: fix unmap of indirect descriptors
Matthias Lange [Fri, 6 Sep 2019 14:59:01 +0000 (16:59 +0200)]
virtio_ring: fix unmap of indirect descriptors

The function virtqueue_add_split() DMA-maps the scatterlist buffers. In
case a mapping error occurs the already mapped buffers must be unmapped.
This happens by jumping to the 'unmap_release' label.

In case of indirect descriptors the release is wrong and may leak kernel
memory. Because the implementation assumes that the head descriptor is
already mapped it starts iterating over the descriptor list starting
from the head descriptor. However for indirect descriptors the head
descriptor is never mapped in case of an error.

The fix is to initialize the start index with zero in case of indirect
descriptors and use the 'desc' pointer directly for iterating over the
descriptor chain.

Signed-off-by: Matthias Lange <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
5 years agodrm/i915: Restore relaxed padding (OCL_OOB_SUPPRES_ENABLE) for skl+
Chris Wilson [Wed, 4 Sep 2019 10:07:07 +0000 (11:07 +0100)]
drm/i915: Restore relaxed padding (OCL_OOB_SUPPRES_ENABLE) for skl+

This bit was fliped on for "syncing dependencies between camera and
graphics". BSpec has no recollection why, and it is causing
unrecoverable GPU hangs with Vulkan compute workloads.

From BSpec, setting bit5 to 0 enables relaxed padding requirements for
buffers, 1D and 2D non-array, non-MSAA, non-mip-mapped linear surfaces;
and *must* be set to 0h on skl+ to ensure "Out of Bounds" case is
suppressed.

Reported-by: Jason Ekstrand <[email protected]>
Suggested-by: Jason Ekstrand <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110998
Fixes: 8424171e135c ("drm/i915/gen9: h/w w/a: syncing dependencies between camera and graphics")
Signed-off-by: Chris Wilson <[email protected]>
Tested-by: [email protected]
Cc: Jason Ekstrand <[email protected]>
Cc: Mika Kuoppala <[email protected]>
Cc: <[email protected]> # v4.1+
Reviewed-by: Mika Kuoppala <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit 9d7b01e93526efe79dbf75b69cc5972b5a4f7b37)
Signed-off-by: Jani Nikula <[email protected]>
5 years agodrm/i915: Limit MST to <= 8bpc once again
Ville Syrjälä [Wed, 28 Aug 2019 10:20:59 +0000 (13:20 +0300)]
drm/i915: Limit MST to <= 8bpc once again

My attempt at allowing MST to use the higher color depths has
regressed some configurations. Apparently people have setups
where all MST streams will fit into the DP link with 8bpc but
won't fit with higher color depths.

What we really should be doing is reducing the bpc for all the
streams on the same link until they start to fit. But that requires
a bit more work, so in the meantime let's revert back closer to
the old behavior and limit MST to at most 8bpc.

Cc: [email protected]
Cc: Lyude Paul <[email protected]>
Tested-by: Geoffrey Bennett <[email protected]>
Fixes: f1477219869c ("drm/i915: Remove the 8bpc shackles from DP MST")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111505
Signed-off-by: Ville Syrjälä <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Lyude Paul <[email protected]>
(cherry picked from commit 75427b2a2bffc083d51dec389c235722a9c69b05)
Signed-off-by: Jani Nikula <[email protected]>
5 years agoregulator: lp87565: Simplify lp87565_buck_set_ramp_delay
Axel Lin [Sun, 8 Sep 2019 03:57:20 +0000 (11:57 +0800)]
regulator: lp87565: Simplify lp87565_buck_set_ramp_delay

Use rdev->regmap/&rdev->dev instead of lp87565->regmap/lp87565->dev.
In additional, the lp87565->dev actually is the parent mfd device,
so the dev_err message is misleading here with lp87565->dev.

Signed-off-by: Axel Lin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
5 years agotools/power/x86/intel-speed-select: Display core count for bucket
Srinivas Pandruvada [Sun, 8 Sep 2019 14:42:25 +0000 (07:42 -0700)]
tools/power/x86/intel-speed-select: Display core count for bucket

Read the bucket and core count relationship via MSR and display
when displaying turbo ratio limits.

Signed-off-by: Srinivas Pandruvada <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
5 years agoplatform/x86: ISST: Allow additional TRL MSRs
Srinivas Pandruvada [Thu, 5 Sep 2019 23:37:47 +0000 (16:37 -0700)]
platform/x86: ISST: Allow additional TRL MSRs

Additional Turbo Ratio Limit (TRL) MSRs are required to get bucket vs core
count relationship. So add them to the list of allowed MSRs.

Signed-off-by: Srinivas Pandruvada <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
5 years agospi-gpio: Use PTR_ERR_OR_ZERO() in spi_gpio_request()
Markus Elfring [Sat, 7 Sep 2019 11:51:16 +0000 (13:51 +0200)]
spi-gpio: Use PTR_ERR_OR_ZERO() in spi_gpio_request()

Simplify this function implementation by using a known function.

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Signed-off-by: Markus Elfring <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
5 years agoregulator: slg51000: use devm_gpiod_get_optional() in probe
Dmitry Torokhov [Wed, 4 Sep 2019 21:42:00 +0000 (14:42 -0700)]
regulator: slg51000: use devm_gpiod_get_optional() in probe

The CS GPIO line is clearly optional GPIO (and marked as such in the
binding document) and we should handle it accordingly. The current code
treats all errors as meaning that there is no GPIO defined, which is
wrong, as it does not handle deferrals raised by the underlying code
properly, nor does it recognize non-existing GPIO from any other
initialization error.

As far as I can see the only reason the driver, unlike all others,
is using OF-specific devm_gpiod_get_from_of_node() so that it can
assign a custom label to the selected GPIO line. Given that noone else
needs that, it should not be doing that either.

Let's switch to using more appropriate devm_gpiod_get_optional().

Signed-off-by: Dmitry Torokhov <[email protected]>
Link: https://lore.kernel.org/r/20190904214200.GA66118@dtor-ws
Signed-off-by: Mark Brown <[email protected]>
5 years agoMerge branch 'regulator-5.3' into regulator-5.4
Mark Brown [Mon, 9 Sep 2019 09:56:10 +0000 (10:56 +0100)]
Merge branch 'regulator-5.3' into regulator-5.4

5 years agoregulator: lp8788-ldo: make array en_mask static const, makes object smaller
Colin Ian King [Fri, 6 Sep 2019 13:06:32 +0000 (14:06 +0100)]
regulator: lp8788-ldo: make array en_mask static const, makes object smaller

Don't populate the array en_mask on the stack but instead make it
static const. Makes the object code smaller by 87 bytes.

Before:
   text    data     bss     dec     hex filename
  12967    3408       0   16375    3ff7 drivers/regulator/lp8788-ldo.o

After:
   text    data     bss     dec     hex filename
  12816    3472       0   16288    3fa0 drivers/regulator/lp8788-ldo.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
5 years agogpio: fix line flag validation in lineevent_create
Kent Gibson [Mon, 9 Sep 2019 03:24:06 +0000 (03:24 +0000)]
gpio: fix line flag validation in lineevent_create

lineevent_create should not allow any of GPIOHANDLE_REQUEST_OUTPUT,
GPIOHANDLE_REQUEST_OPEN_DRAIN or GPIOHANDLE_REQUEST_OPEN_SOURCE to be set.

Fixes: d7c51b47ac11 ("gpio: userspace ABI for reading/writing GPIO lines")
Cc: stable <[email protected]>
Signed-off-by: Kent Gibson <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
5 years agogpio: fix line flag validation in linehandle_create
Kent Gibson [Mon, 9 Sep 2019 03:22:18 +0000 (03:22 +0000)]
gpio: fix line flag validation in linehandle_create

linehandle_create should not allow both GPIOHANDLE_REQUEST_INPUT
and GPIOHANDLE_REQUEST_OUTPUT to be set.

Fixes: d7c51b47ac11 ("gpio: userspace ABI for reading/writing GPIO lines")
Cc: stable <[email protected]>
Signed-off-by: Kent Gibson <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
5 years agogpio: mockup: add missing single_release()
Wei Yongjun [Wed, 4 Sep 2019 14:18:34 +0000 (14:18 +0000)]
gpio: mockup: add missing single_release()

When using single_open() for opening, single_release() should be
used instead of seq_release(), otherwise there is a memory leak.

Fixes: 2a9e27408e12 ("gpio: mockup: rework debugfs interface")
Cc: stable <[email protected]>
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Bartosz Golaszewski <[email protected]>
5 years agoLinux 5.3-rc8 v5.3-rc8
Linus Torvalds [Sun, 8 Sep 2019 20:33:15 +0000 (13:33 -0700)]
Linux 5.3-rc8

5 years agoMerge tag 'compiler-attributes-for-linus-v5.3-rc8' of git://github.com/ojeda/linux
Linus Torvalds [Sun, 8 Sep 2019 16:34:55 +0000 (09:34 -0700)]
Merge tag 'compiler-attributes-for-linus-v5.3-rc8' of git://github.com/ojeda/linux

Pull section attribute fix from Miguel Ojeda:
 "Fix Oops in Clang-compiled kernels (Nick Desaulniers)"

* tag 'compiler-attributes-for-linus-v5.3-rc8' of git://github.com/ojeda/linux:
  include/linux/compiler.h: fix Oops for Clang-compiled kernels

This page took 0.12392 seconds and 4 git commands to generate.