Commit Graph

707733 Commits

Author SHA1 Message Date
Linus Torvalds c925e0ea50 MMC host:
- sdhci-pci: Fix default d3_retune for Intel host controllers
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZ6bFsAAoJEP4mhCVzWIwpFEsP/3C3ZGudAZeVzrCIhCzP/hdm
 Bior/PuFVxAXfZS0rp76/5vWkJMpJYdUsi9aL4+Qme8j5LoMn/d7faClwfHN9vOW
 Diug1UDB/TKmcYsmZCtSkv+30gxZtMMtS6U7J9QlUcjsWdusbJM3DMZllx/nCA+u
 wzbYufJl7ckLpL/yqWNpSJn0xnkH3/IAElUy1FJIIfgT2HEMKsrOIx99OM6w5nPW
 EcF5crKJFLB8UyGj8SwWgxZOYr7GvCMVNvxEzQ2zIvhq7lpCisjzn/CYWUveDatr
 mHkx8VYwgP1spwgfyHv2KRV1E4T6D7pbe9vMZEl8gXxJ8JQrEEPljd+P4tVMF9iM
 XmZ8Cpm5IBCdmJnuVPekOTNA4lisCIqP9wz25ExWQ6PzNxZGft7pcwNKxOjUVc4h
 Rh6r6GZcezgd87i4hbWubPLtpIMo7+Daje4earB1AGHmGw6G7IoIIGXnXrEg6bEo
 0UoX8TeGdalGR6p6I6Bqo591PZs3PdF5iltVQnrSx5Bg46lNCuQVPMhxPtdRMq/q
 PfAozDsSZBWRFWhZttjWlAA8S7a5iTFdI1DCwwitf3jmJ/L3AM7c+vifJidE33SZ
 oVReVGZRkHBWBfgvU8DeXm8u2blGPO1AKVI9JH1y6peUkIbrsT6v4A7Fj/XmJf7V
 VTnX7bfuzPpk1x0JCQgZ
 =gDOy
 -----END PGP SIGNATURE-----

Merge tag 'mmc-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC fix from Ulf Hansson:
 "sdhci-pci: Fix default d3_retune for Intel host controllers"

* tag 'mmc-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: sdhci-pci: Fix default d3_retune for Intel host controllers
2017-10-20 06:52:05 -04:00
Linus Torvalds d92116a089 amdgpu, nouveau, i915 and exynos fixes
-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJZ6Y+3AAoJEAx081l5xIa+dEIP/j5tjawx4ada7etPbAblFjmD
 cs0LUFM6SgamUtgi5slJn+3jV1bXJpgcmCXI0S6Ln7xjLLvjcTnauJFidrBgT1lG
 dJOrzz8zgBF2jpc0oC/a3ercum3vncqxAbUbDQ6RwDrxuhwBB3L31ix263z/+Yr8
 fy655TSpxTiaokiVxws2mOfpte9yWcSeQUChrzRjNSS480O4qd/AJZl+FhiBNySw
 2kAW9zbTFEV/9qfANHToAeUsCOo2VoTBXqgpvPiUKJG2gow8yT0Wf5Al4HcagZCt
 9JtIbNlHxnuSYR0CCfx4r+/igWQt52O2GgmlPkaxvGjVz13n9m9RngYyyZksZWjQ
 9wBJEQI4pvCUIBHpic+90b9AKTIub52bImigNzckEDvvXXEIO4SUc23s6pkOKXD8
 V4ZO+pHtzV6/T9vGpntrbODcwp7/h397Zr6SKP+YjRl12Gh5/922xz3bQDnEgYF/
 o/q/stEm5Jqncz4WR+wZ2a7gocPxuexv6T/hZwvT+08l/QR5DR0sUhlJ+j3QaSqk
 ELqn5tNEGQiOEDLHmBnjiHZJFYAAlbOkPoVPIMuFt/xRZtDb2ZCN457OgSubmPqw
 1i00XLd6ZoEVI+nBcGJbyQhqZmcTftWXXvcCixBqvK9mEYFqQoe222bytaIoiPpo
 WT3Zt2E6jgoQxtX3PftU
 =wFHG
 -----END PGP SIGNATURE-----

Merge tag 'drm-fixes-for-v4.14-rc6' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Standard fixes pull for rc6: one regression fix for amdgpu, a bunch of
  nouveau fixes that I'd missed a pull req for from Ben last week, some
  exynos regression fixes, and a few fixes for i915"

* tag 'drm-fixes-for-v4.14-rc6' of git://people.freedesktop.org/~airlied/linux:
  drm/nouveau/fbcon: fix oops without fbdev emulation
  Revert "drm/amdgpu: discard commands of killed processes"
  drm/i915: Use a mask when applying WaProgramL3SqcReg1Default
  drm/i915: Report -EFAULT before pwrite fast path into shmemfs
  drm/i915/cnl: Fix PLL initialization for HDMI.
  drm/i915/cnl: Fix PLL mapping.
  drm/i915: Use bdw_ddi_translations_fdi for Broadwell
  drm/i915: Fix eviction when the GGTT is idle but full
  drm/i915/gvt: Fix GPU hang after reusing vGPU instance across different guest OS
  drm/exynos: Clear drvdata after component unbind
  drm/exynos: Fix potential NULL pointer dereference in suspend/resume paths
  drm/nouveau/kms/nv50: fix oops during DP IRQ handling on non-MST boards
  drm/nouveau/bsp/g92: disable by default
  drm/nouveau/mmu: flush tlbs before deleting page tables
2017-10-20 06:38:56 -04:00
Linus Torvalds eb62722a06 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang:
 "A couple of bugfixes for I2C drivers.

  Because the changes for the piix4 driver are larger than usual, the
  patches have been in linux-next for more than a week with no reports
  coming in. The rest is usual stuff"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: omap: Fix error handling for clk_get()
  i2c: piix4: Disable completely the IMC during SMBUS_BLOCK_DATA
  i2c: piix4: Fix SMBus port selection for AMD Family 17h chips
  i2c: imx: fix misleading bus recovery debug message
  i2c: imx: use IRQF_SHARED mode to request IRQ
  i2c: ismt: Separate I2C block read from SMBus block read
2017-10-20 06:32:26 -04:00
Linus Torvalds 03b652e5c0 Merge branch 'fixes-v4.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull key handling fixes from James Morris:
 "This includes a fix for the capabilities code from Colin King, and a
  set of further fixes for the keys subsystem. From David:

   - Fix a bunch of places where kernel drivers may access revoked
     user-type keys and don't do it correctly.

   - Fix some ecryptfs bits.

   - Fix big_key to require CONFIG_CRYPTO.

   - Fix a couple of bugs in the asymmetric key type.

   - Fix a race between updating and finding negative keys.

   - Prevent add_key() from updating uninstantiated keys.

   - Make loading of key flags and expiry time atomic when not holding
     locks"

* 'fixes-v4.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  commoncap: move assignment of fs_ns to avoid null pointer dereference
  pkcs7: Prevent NULL pointer dereference, since sinfo is not always set.
  KEYS: load key flags and expiry time atomically in proc_keys_show()
  KEYS: Load key expiry time atomically in keyring_search_iterator()
  KEYS: load key flags and expiry time atomically in key_validate()
  KEYS: don't let add_key() update an uninstantiated key
  KEYS: Fix race between updating and finding a negative key
  KEYS: checking the input id parameters before finding asymmetric key
  KEYS: Fix the wrong index when checking the existence of second id
  security/keys: BIG_KEY requires CONFIG_CRYPTO
  ecryptfs: fix dereference of NULL user_key_payload
  fscrypt: fix dereference of NULL user_key_payload
  lib/digsig: fix dereference of NULL user_key_payload
  FS-Cache: fix dereference of NULL user_key_payload
  KEYS: encrypted: fix dereference of NULL user_key_payload
2017-10-20 06:19:38 -04:00
Craig Bergstrom ce56a86e2a x86/mm: Limit mmap() of /dev/mem to valid physical addresses
Currently, it is possible to mmap() any offset from /dev/mem.  If a
program mmaps() /dev/mem offsets outside of the addressable limits
of a system, the page table can be corrupted by setting reserved bits.

For example if you mmap() offset 0x0001000000000000 of /dev/mem on an
x86_64 system with a 48-bit bus, the page fault handler will be called
with error_code set to RSVD.  The kernel then crashes with a page table
corruption error.

This change prevents this page table corruption on x86 by refusing
to mmap offsets higher than the highest valid address in the system.

Signed-off-by: Craig Bergstrom <craigb@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luis R. Rodriguez <mcgrof@suse.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: dsafonov@virtuozzo.com
Cc: kirill.shutemov@linux.intel.com
Cc: mhocko@suse.com
Cc: oleg@redhat.com
Link: http://lkml.kernel.org/r/20171019192856.39672-1-craigb@google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-10-20 09:48:00 +02:00
Kamalesh Babulal b703798386 objtool: Fix memory leak in decode_instructions()
When an error occurs before adding an allocated insn to the list, free
it before returning.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/336da800bf6070eae11f4e0a3b9ca64c27658114.1508430423.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-10-20 09:43:21 +02:00
Ingo Molnar 275d34b825 perf/urgent fixes:
- Fix crash in perf_hpp__reset_output_field() (Jiri Olsa)
 
 - Fix eBPF file/vendor events ambiguity in event specification (Jiri Olsa)
 
 - Fix closing evsel fd in 'perf stat' (Jin Yao)
 
 - Make perf test shell trace+probe_libc_inet_pton.sh pass in Debian/Ubuntu (Li Zhijian)
 
 - Fix 'perf buildid-list --with-hits' crash when processing PERF_RECORD_NAMESPACE (Namhyung Kim)
 
 - Fix documentation for a inexistent option 'perf record -l' (Taeung Song)
 
 - Add long time reviewers to MAINTAINERS (Arnaldo Carvalho de Melo)
 
 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEELb9bqkb7Te0zijNb1lAW81NSqkAFAlno4cEACgkQ1lAW81NS
 qkBAlhAAk9LUUvFLLB2R2U33qoLskEL+r88wTdTPQSNf8caCr01m/ae+WiB69MpX
 80WaHzGPXue0NBuWQhaND8/R0muKvDgCDWKSL3yic2Qk2hRe2g1a6I6cjp01hQix
 ajfNu15w2p3awKuXi6xOBRjQM7MiW0zioEURNEuyKlBOKC7VivMHOUJAyZSOkAce
 uFNqfYwS8EPM3FobV+iL7P0R86JdaGc0VZ172gqs9uLgdROtsXms3bbbj/ixTIKG
 Uwl34SUJMhpgk4q1lMJBtps3Ntjtop/0TWJdhhEWRxEQqti8q2JnfXfQHp9miLPu
 k85IH4x3Kxq7ZxNzCqlKFGpLsTq3NQEiT6QDYIjBYcVz7HGgYLzrLAcsIO5+Sh2P
 3iFwALfUGfgTIQoKBz5fVClDDnbCf1GAuZUOUetJSsGzU3dj15R6oMKRZWV12qFr
 rNYWQ+voOV38mCvcGNBCZ8quZelixrLdOACU8mzP0ePWElGnuW4Q7ecIHZuluET+
 9r2pKrPH8Ze3/0w+0CkdxXLB6ZfFS4cxCLR2j0UZxgO/vQKODbwWS6Vak+b6xM50
 TQLS224PIJL0EVC/WTReVkWli3ksTTzcr/E/siv778rD3xhZfEdlUZGuBDZTj3pZ
 Hr0jQsVTWhQNVt1t+xOpRHsL7JZIXNWIT/PSJZAKU9godtoNqp0=
 =nqkB
 -----END PGP SIGNATURE-----

Merge tag 'perf-urgent-for-mingo-4.14-20171019' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent

Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

- Fix crash in perf_hpp__reset_output_field() (Jiri Olsa)

- Fix eBPF file/vendor events ambiguity in event specification (Jiri Olsa)

- Fix closing evsel fd in 'perf stat' (Jin Yao)

- Make perf test shell trace+probe_libc_inet_pton.sh pass in Debian/Ubuntu (Li Zhijian)

- Fix 'perf buildid-list --with-hits' crash when processing PERF_RECORD_NAMESPACE (Namhyung Kim)

- Fix documentation for an inexistent option 'perf record -l' (Taeung Song)

- Add long time reviewers to MAINTAINERS (Arnaldo Carvalho de Melo)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-10-20 09:14:06 +02:00
Stefan Roese c5709d3769 dmaengine: altera: Use IRQ-safe spinlock calls in the error paths as well
The patch edf10919 [dmaengine: altera: fix spinlock usage] missed to
change 2 occurrences of spin_unlock_bh() to spin_unlock_irqrestore().
This patch fixes this by moving to the IRQ-safe call in the error
paths as well.

Fixes: edf10919 (dmaengine: altera: fix spinlock usage)
Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Sylvain Lesne <lesne@alse-fr.com>
[add fixes tag and fix typo in log]
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2017-10-20 11:51:10 +05:30
Linus Torvalds ce43f4fd6f Power management fix for v4.14-rc6
This reverts a problematic commit modifying the turbostat
 utility that went in during the 4.13 cycle (Len Brown).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJZ6Sp6AAoJEILEb/54YlRxt+4QAIZUZUiOgnm+xnTt/jO+RFqn
 QhemEUf5pJFvt0HGdIOaA4VzicyAaSnA1+QoSiHJhIk8itsVCnI9COpfb0BwYvnU
 B26gtT0+H+pvu2PVSVrihZZ27S5zJfIZ+3bfSqMUB/uvvIkRVD0g7OMBNPPttGVz
 iF1HRWOgK4w88zy2MNyvdmqagOwAdnptMB3RCasAIh4HlOkdAeJ0qGsru0UKxKd1
 mZGp2WxHE66cTNAheX/ONyK0N1X+4WiCcxuUTGa0O3YyT6Ll3FbWbxsh7GcmJ7aa
 +UpOXDPKBzsZzjHUB+a8rECChbtrzEAJ1AJc2QB0ZPw2Id1Fo6rxgkMCs+YoNDiz
 mBqhGAF9VcD9az9DqbMEHwkWHiOTEjgsUwKAVFEYV23nm5sTGIBVc5W/0StG8Kz7
 IQeeapN9kqc2ty+lD8cCfC+NU1EVn3Ca5s85vnWnK3bmmolHEVpzdUzLc9vYrFnP
 JKkNA2n3/9UvC3DRDr7ykD0wro77yA/mcjRLHmMxleLo7YEKZF1aPmsiOlgJiP5K
 LTnkpnhUSIz7W/9v1Gh2pYpiwppJBgp5RXZGXGY/vTA42t0HZeZquGgNub5b0ys7
 +JPrb5jlgYmg4DXXWT2htq8cjTisxJI+6uAtD7oULondtMISZCWtm0CMxgksmATA
 567h1DJHd0zvO7r7mlRa
 =i876
 -----END PGP SIGNATURE-----

Merge tag 'pm-4.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management fix from Rafael Wysocki:
 "This reverts a problematic commit modifying the turbostat utility that
  went in during the 4.13 cycle (Len Brown)"

* tag 'pm-4.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  Revert "tools/power turbostat: stop migrating, unless '-m'"
2017-10-19 22:49:21 -04:00
Paul E. McKenney 27fdb35fe9 doc: Fix various RCU docbook comment-header problems
Because many of RCU's files have not been included into docbook, a
number of errors have accumulated.  This commit fixes them.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-10-19 22:26:11 -04:00
Paul E. McKenney 533966c8ad doc: Fix RCU's docbook options
Commit 764f80798b ("doc: Add RCU files to docbook-generation files")
added :external: options for RCU source files in the file
Documentation/core-api/kernel-api.rst.  However, this now means nothing,
so this commit removes them.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: Akira Yokosawa <akiyks@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-10-19 22:26:11 -04:00
Mathieu Desnoyers a961e40917 membarrier: Provide register expedited private command
This introduces a "register private expedited" membarrier command which
allows eventual removal of important memory barrier constraints on the
scheduler fast-paths. It changes how the "private expedited" membarrier
command (new to 4.14) is used from user-space.

This new command allows processes to register their intent to use the
private expedited command.  This affects how the expedited private
command introduced in 4.14-rc is meant to be used, and should be merged
before 4.14 final.

Processes are now required to register before using
MEMBARRIER_CMD_PRIVATE_EXPEDITED, otherwise that command returns EPERM.

This fixes a problem that arose when designing requested extensions to
sys_membarrier() to allow JITs to efficiently flush old code from
instruction caches.  Several potential algorithms are much less painful
if the user register intent to use this functionality early on, for
example, before the process spawns the second thread.  Registering at
this time removes the need to interrupt each and every thread in that
process at the first expedited sys_membarrier() system call.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-10-19 22:13:40 -04:00
Dmitry Torokhov ea04efee76 Input: ims-psu - check if CDC union descriptor is sane
Before trying to use CDC union descriptor, try to validate whether that it
is sane by checking that intf->altsetting->extra is big enough and that
descriptor bLength is not too big and not too small.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-10-19 17:20:06 -07:00
Roderick Colenbrander 20ac95d52a Input: joydev - blacklist ds3/ds4/udraw motion sensors
Introduce a device table used for blacklisting devices. We currently
blacklist the motion sensor subdevice of THQ Udraw and Sony ds3/ds4.

Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
[dtor: siwtched to blacklist built on input_device_id and using
input_match_device_id()]
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-10-19 16:55:39 -07:00
Dmitry Torokhov 8724ecb072 Input: allow matching device IDs on property bits
Let's allow matching input devices on their property bits, both in-kernel
and when generating module aliases.

Tested-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-10-19 16:54:49 -07:00
Dmitry Torokhov 55dfce873d Input: factor out and export input_device_id matching code
Factor out and export input_match_device_id() so that modules may use it.
It will be needed by joydev to blacklist accelerometers in composite
devices.

Tested-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-10-19 16:53:34 -07:00
Paul Cercueil 9b5db7aab4 Input: goodix - poll the 'buffer status' bit before reading data
The Goodix panel triggers an interrupt on touch events. However, its
registers will contain the valid values a short time after the
interrupt, and not when it's raised. At that moment, the 'buffer status'
bit is set.

Previously, if the 'buffer status' bit was not set when the registers
were read, the data was discarded and no input event was emitted,
causing "finger down" or "finger up" events to be missed sometimes.

This went unnoticed until v4.9, as the DesignWare I2C driver commonly
used with this driver had enough latency for that bug to never trigger
until commit 2702ea7dbe ("i2c: designware: wait for disable/enable only
if necessary").

Now, in the IRQ handler we will poll (with a timeout) the 'buffer status'
bit and process the data of the panel as soon as this bit gets set.

Note that the Goodix panel will send a few spurious interrupts after the
'finger up' event, in which the 'buffer status' bit will never be set.

Cc: Bastien Nocera <hadess@hadess.net>
Cc: russianneuromancer@ya.ru
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
[hdegoede@redhat.com: Change poll loop to use jiffies,
                      add comment about typical poll time]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
[dtor: rearranged control flow a bit to avoid explicit goto and double
check]
Reviewed-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-10-19 16:50:39 -07:00
Hans de Goede 481c209fa0 Input: axp20x-pek - fix module not auto-loading for axp221 pek
Now that we have a platform_device_id table and multiple supported ids
we should be using MODULE_DEVICE_TABLE instead of MODULE_ALIAS.

This fixes a regression on Bay and Cherry Trail devices, where the power
button is now enumerated as an "axp221-pek" and it was impossible to
wakeup these devices from suspend since the module did not load.

Fixes: c3cc94470b ("Input: axp20x-pek - add support for AXP221 PEK")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-10-19 16:50:28 -07:00
Damien Riegel 8f75bc3377 Input: tca8418 - enable interrupt after it has been requested
Currently, enabling keypad interrupts is one of the first operations
done on the keypad, even before the interrupt is requested, so there is
a small time window where the keypad can fire interrupts but the driver
is not yet ready to handle them. It's fine for level interrupts because
they will be handled anyway, but not so much for edge ones.

This commit modifies and moves the function in charge of configuring the
keypad. Enabling interrupts is now the last thing done on the keypad,
and after the interrupt has been requested by the driver.

Writing to the config register was also used to determine if the device
was indeed present on the bus or not, this has been replaced by reading
the lock/event count register to keep the same functionality.

Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-10-19 16:50:20 -07:00
Linus Torvalds 96f893abc8 Merge branch 'parisc-4.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc fixes from Helge Deller:
 "Three small important fixes for the parisc architecture:

   - Export __cmpxchg_u64() symbol on 32bit kernel too. This unbreaks
     building the kernel with ixgbe kernel module. From Guenter Roeck.

   - Fix 64-bit atomic cmpxchg kernel helper function for 32-bit kernel
     in LWS code for userspace. This unbreaks e.g. the 64-bit variant of
     the glibc function __sync_fetch_and_add() with a 32-bit parisc
     kernel. From John David Anglin, tagged for backport to v3.13+.

   - Detect nonsynchronous CPU-internal cr16 cycle counters more
     reliable. This avoids stalled CPU warnings by the kernel soft
     lockup detector. From me, tagged for backport to v4.13+"

* 'parisc-4.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc: Fix detection of nonsynchronous cr16 cycle counters
  parisc: Export __cmpxchg_u64 unconditionally
  parisc: Fix double-word compare and exchange in LWS code on 32-bit kernels
2017-10-19 16:18:58 -04:00
Linus Torvalds 962556b57c sound fixes for 4.14-rc6
We've got slightly more fixes than wished, but heading to a good
 shape.  Most of changes are about HD-audio fixes, one for a buggy code
 that went into 4.13, and another for avoiding a crash due to buggy
 BIOS.
 
 Apart from HD-audio, a sequencer core change that is only for UP
 config (which must be pretty rare nowadays), and a USB-audio quirk as
 usual.
 -----BEGIN PGP SIGNATURE-----
 
 iQJCBAABCAAsFiEECxfAB4MH3rD5mfB6bDGAVD0pKaQFAlnonUQOHHRpd2FpQHN1
 c2UuZGUACgkQbDGAVD0pKaSnrg//fpNJWcF2sCUMSsqxA+6iy5oVcsNEueockO/q
 iUj60clC9f+GKx2f/ZxWGQTZA1ffZiD6anc77O0adDG+pXyeaRHzUgEgGm0sjeR3
 TOy0izBZfI7iJBC0EwPKSohqZK/ogk0dXRosTooJ4EY2w+3RSBXhYKTFO812LpvA
 z/t8Rbyw1Iurjrc/3myx3CNIgHfM07Oc1PZmlJXIHyMBLgEC+PfA/7yI4P0wp1VD
 73TpRRszVKkpmqF3KaQjQ0HGTaL6Afx/JMYCSz2LQiKLi5Q9+faI/EGDRxpwh7LY
 be8hwe7J6mRSEq5ffWO9o0cz8VNVbGL7C7FXvFTJT8HjnrypdtX3qgn+9sa0kiKk
 Zr2gygoItkDKIz5zmgGrxTAHh15O76YJga0qQ1de1mqKEiBsEZO5jFAh4H4MXMRQ
 TXWT76J015m87d2ujdMrD0OmML4UXmRcy+cZd883iDpJvGBhIROFd0J7fY96fAqd
 +mD+hL847FkRGXql04wj73m7HzbZ8ZZ6juSViDy8ioKoYkFmNaIeUtlgPWPcw50j
 qi8SYkg+DCXbGWGaPh+l+n685Ibz2W4VdtiPaAu4WkIrKEkxa/J020GzRgHm6+ke
 CD+MGqo/S5a3MJoLZGUtYKl2FYJv51MueKHk00p+ZkyHWtC9xo+wLg4dc3Ip83ir
 jWrpVSg=
 =YGib
 -----END PGP SIGNATURE-----

Merge tag 'sound-4.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound fixes from Takashi Iwai:
 "We've got slightly more fixes than wished, but heading to a good
  shape. Most of changes are about HD-audio fixes, one for a buggy code
  that went into 4.13, and another for avoiding a crash due to buggy
  BIOS.

  Apart from HD-audio, a sequencer core change that is only for UP
  config (which must be pretty rare nowadays), and a USB-audio quirk as
  usual"

* tag 'sound-4.14-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
  ALSA: hda - Fix incorrect TLV callback check introduced during set_fs() removal
  ALSA: hda: Remove superfluous '-' added by printk conversion
  ALSA: hda: Abort capability probe at invalid register read
  ALSA: seq: Enable 'use' locking in all configurations
  ALSA: usb-audio: Add native DSD support for Pro-Ject Pre Box S2 Digital
2017-10-19 16:15:17 -04:00
Arnd Bergmann 716479a39f Renesas ARM Based SoC Fixes for v4.14
Add 12V regulator to backlight allowing the power supply
 for the backlight to be found.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZyLGhAAoJENfPZGlqN0++U5oQAKjIikenaz1ZlG25+cWCgkxa
 E+PMqSH49eUpHqtJlHC0nRF4H9terzMMLHYQPL1SZME8j56x5bjGI80OtnBKdD0V
 GxXrpPv9ekl5vBBroQM6/1ZS9v1aFWjlNzpV1jC+TQwtTEo2xzr4+DJ+z4vllyps
 bptOIn3ix/NuNSl5P146buSOKBumSB4advGh9emzrsGc41RUCgfaGZmIlyvmkorf
 3vW/NW9fBk+bauZT2AH1gYEsxlCMPBr6EmUJAiSLAAuEXf8SsSs16ls6E5sGEEhO
 AhuKh3lfK3TZNEGiC2pDv2WNqQyr+gNM2mDRnwcIXqDpvXYtFPUHN3EcSpf+stXa
 yrJMro9BJeKmzHj7jReArxMOJsLF8KIx6udUobJ1hKAxGQJlxopJmhldGXBarMV1
 enGhp7qGSVf5VpMf2iNJo6pU6MNRB3dnel+3LtwhwG0Uxu8Y2dsWcrwxSFipmlnJ
 nAsoC3cuewHuPHCYGvyRoQ6RtKcdJ1XVcMg9nYvbQVkyBUl8o+Y/4Ock17jpG5ro
 a+F8XBowk4q1INm3QQHIqSqi7G4K01Tnhw95hcudbJwc26wtGY79CqifiKmnOq6+
 MRAG0UvtMUOVgD++vSE5vTg/f8lfRFYUu+aCCzTjEzUs1/rawXyk8I4nEqZjZx3Q
 n0U8qQGkOeZ1jUpktZz3
 =zIL3
 -----END PGP SIGNATURE-----

Merge tag 'renesas-fixes-for-v4.14' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into fixes

Pull "Renesas ARM Based SoC Fixes for v4.14" from Simon Horman:

Add 12V regulator to backlight allowing the power supply
for the backlight to be found.

* tag 'renesas-fixes-for-v4.14' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  arm64: dts: salvator-common: add 12V regulator to backlight
2017-10-19 17:58:13 +02:00
Ulf Hansson 72ecd79386 ARM: ux500: Fix regression while init PM domains
The commit afece3ab9a ("PM / Domains: Add time accounting to various
genpd states") causes a boot regression for ux500.

The problem occurs when the ux500 machine code calls pm_genpd_init(), which
since the above change triggers a call to ktime_get(). More precisely,
because ux500 initializes PM domains in the init_IRQ() phase of the boot,
timekeeping has not yet been initialized.

Fix the problem by moving the initialization of the PM domains to after
timekeeping has been initialized.

Fixes: afece3ab9a ("PM / Domains: Add time accounting to various genpd..")
Cc: Thara Gopinath <thara.gopinath@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2017-10-19 17:46:36 +02:00
Linus Walleij 8633e4f2e9 ARM: dts: fix PCLK name on Gemini and MOXA ART
These platforms provide a clock to their watchdog, in each
case this is the peripheral clock (PCLK), so explicitly
name the clock in the device tree.

Take this opportunity to add the "faraday,ftwdt010"
compatible as fallback to the watchdog IP blocks.

Cc: Jonas Jensen <jonas.jensen@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2017-10-19 17:45:22 +02:00
Arnd Bergmann be2f9d36b2 Reset controller fixes for v4.14
Fix SoCFPGA reset controller for 64-bit systems. This patch removes the
 assumption that BITS_PER_LONG is 32, which is not the case on Stratix10.
 -----BEGIN PGP SIGNATURE-----
 
 iQJLBAABCAA1FiEEBsBxhV1FaKwXuCOBUMKIHHCeYOsFAlnoTdoXHHAuemFiZWxA
 cGVuZ3V0cm9uaXguZGUACgkQUMKIHHCeYOvbRA//aBLiCj9UaS++2D/hPHwm/oZV
 YjjsfCLg+5XA9kULO2oWZ3Tv2rWGVrLUYEDsBuP1n5jCdXwQLIsvDAXCxw7wQdEb
 2MesVrIzp/0u6qHeIoeF7wrcAjE2KjmzVIvLwEdfAK92LLaSi5QvwD7C9xHQNDAW
 P8uHBjAtMt/jHMp3iyh0tOectKtLzUrRC5dWEyM9XJIc4P1cmz5CyyyNP+CGyJpL
 XEI9vudNl3MQEosZoTMUSjuH+ct2BglYZiyw4nKCV0MkIjeWF71SqzcvuUraFd1M
 bebN4FPM+Q/7jX59flt6WZvthiXHy9VdQePdWFAPxFtI2/lxU8yvyTKIA8xn9uXs
 t7blnI/FU+4bAxnWfWf6nlyX5nHAbB44LZqXmMqz1g3WWuiv+kpWK9/L61AToGAB
 fkc0f6D1qLDbbOz/pynhFLOhQg3BYjvkLlOCxr6mKYS+3PMH+fVKzxsSfxmJy2Mx
 FcQZ1h96CRySEXIiXD1xEqCL29xzjC1gEJdHIEM0FP7OHkctXhwRLlk57+O3NWo7
 vCcAQHrxdez27CuLm4HruJf/ne8WvHHO8k+093tlMIgXlxcbIZRoCRgdlYKElbYI
 mu0TrvRvdz/kXRMcA6aUJCCckKQAlG54Qbfo8Mjuv6V/rr3N8X/z0LpgLzrtx/C0
 2sWZW+3J3LmwAqy+PoM=
 =VEC4
 -----END PGP SIGNATURE-----

Merge tag 'reset-fixes-for-4.14-2' of git://git.pengutronix.de/git/pza/linux into fixes

Pull "Reset controller fixes for v4.14" from Philipp Zabel:

Fix SoCFPGA reset controller for 64-bit systems. This patch removes the
assumption that BITS_PER_LONG is 32, which is not the case on Stratix10.

* tag 'reset-fixes-for-4.14-2' of git://git.pengutronix.de/git/pza/linux:
  reset: socfpga: fix for 64-bit compilation
2017-10-19 17:43:43 +02:00
Arnd Bergmann 611e91e15e The vqmmc voltages on rk3399 pose a risk for the chip if they
exceed 3.0V, so they got fixed to not be at 3.3V
 And Arnd found a typo in the recently added iommu nodes.
 -----BEGIN PGP SIGNATURE-----
 
 iQFEBAABCAAuFiEE7v+35S2Q1vLNA3Lx86Z5yZzRHYEFAlnmSIIQHGhlaWtvQHNu
 dGVjaC5kZQAKCRDzpnnJnNEdgeaQB/9JDBD545VzXqsNixEnJOcT+X8sUZpu6OmT
 j3v5kJDPOXLfSP/Ci9S10ldix/JUBZoT2fRJCK5QAzo+NnjYWrC5qPAwGVU90TqY
 KxFZu4f1763AU2ZLw9nGJlFeVHrjhpFdYfe9GpPPLmndjM32cRdGCRI5zDaSB7s8
 popUs6qNGvI5Q770x4/xTfEqDlfdQhmYyNfWumji7ACfLTHYZnpyq0SN/o4qp/rg
 UJaPx/7PGzHIDSrEKRE3i+waG3d7Ix4th9jkmrYFAK2nIiySlZg9WIKWEOqqt+sf
 H8W3ygdlaYZlzIPJhY2r6/W1rQoJSLxxKColLrV32hDkjPfcFon5
 =YPhS
 -----END PGP SIGNATURE-----

Merge tag 'v4.14-rockchip-dts64fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into fixes

Pull "Rockchip dts64 Fixes for 4.14 part 2" from Heiko Stübner:

The vqmmc voltages on rk3399 pose a risk for the chip if they
exceed 3.0V, so they got fixed to not be at 3.3V
And Arnd found a typo in the recently added iommu nodes.

* tag 'v4.14-rockchip-dts64fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip:
  arm64: dts: rockchip: fix typo in iommu nodes
  arm64: dts: rockchip: correct vqmmc voltage for rk3399 platforms
2017-10-19 17:42:30 +02:00
Arnd Bergmann a777713c3a i.MX fixes for 4.14:
- Fix the legacy PCI interrupt numbers for i.MX7.  The numbers were
    wrongly coded in an inverted order than what Reference Manual tells.
    It causes problem for PCI devices using legacy interrupt.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJZ5F/UAAoJEFBXWFqHsHzOQCwH/3SfH9+Akv0M0noDacXyzD+2
 MvQGppmagSl8TNeeP0kYc7wk2TeuYc24LJyEAR5xhDwkxL5LGLbXtMr5LqxJszcB
 smQqS9MHpyuIboepw3xBcDBi+vOy9fmrLv7WUnM3yEXWh6gR6VYYU0D4jK/xYmUo
 urH0j8etj5sao02s7D3O0iSEvaxIxtjOHB6i9fCcHNtJXo7iw2lv0XhyQhE73IX2
 LFkRCdtj8EBb+gjPQrXMUE0gn67mvxuzwOOVunEGwl/13cI3WQoRh7pugTB7NBNQ
 fVyBW/8TLOqkKjPinqbnyMVdS1rwel+pfC2Q8jVnjfGNjrmnCxWbcR4R8YqQJsw=
 =+4ri
 -----END PGP SIGNATURE-----

Merge tag 'imx-fixes-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into fixes

Pull "i.MX fixes for 4.14" from Shawn Guo:

 - Fix the legacy PCI interrupt numbers for i.MX7.  The numbers were
   wrongly coded in an inverted order than what Reference Manual tells.
   It causes problem for PCI devices using legacy interrupt.

* tag 'imx-fixes-4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  ARM: dts: imx7d: Invert legacy PCI irq mapping
2017-10-19 17:41:22 +02:00
Arnd Bergmann 840907f941 mvebu fixes for 4.14 (part 2)
Two device tree related fixes:
 
 - One on Armada 38x using a other compatible string for I2C in order
   to cover an errata.
 
 - One for Armada 7K/8K fixing a typo on interrupt-map property for
   PCIe leading to fail PME and AER root port service initialization
 
 And the last one for the mbus fixing the window size calculation when
 it exceed 32bits
 -----BEGIN PGP SIGNATURE-----
 
 iIEEABECAEEWIQQYqXDMF3cvSLY+g9cLBhiOFHI71QUCWeDbriMcZ3JlZ29yeS5j
 bGVtZW50QGZyZWUtZWxlY3Ryb25zLmNvbQAKCRALBhiOFHI71RAJAJ9TyT+GrMdf
 HsM7V74bSWYAUlWZ0ACcCWjIdnbVlinP+iuVS462du4HpU0=
 =2AQR
 -----END PGP SIGNATURE-----

Merge tag 'mvebu-fixes-4.14-2' of git://git.infradead.org/linux-mvebu into fixes

Pull "mvebu fixes for 4.14 (part 2)" from Gregory CLEMENT

Two device tree related fixes:

- One on Armada 38x using a other compatible string for I2C in order
  to cover an errata.

- One for Armada 7K/8K fixing a typo on interrupt-map property for
  PCIe leading to fail PME and AER root port service initialization

And the last one for the mbus fixing the window size calculation when
it exceed 32bits

* tag 'mvebu-fixes-4.14-2' of git://git.infradead.org/linux-mvebu:
  bus: mbus: fix window size calculation for 4GB windows
  ARM: dts: Fix I2C repeated start issue on Armada-38x
  arm64: dts: marvell: fix interrupt-map property for Armada CP110 PCIe controller
2017-10-19 17:40:11 +02:00
Arnd Bergmann ca7325a2b1 Fixes: second batch for 4.14:
- one DT phy address fix for the new sama5d27 som1 ek
 - two DT ADC patches that were forgotten while moving to
   hardware triggers for sama5d2 (iio changes already applied)
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJZ24QUAAoJEAf03oE53VmQHGAIAJcmiYj0qsO8ModMQjFSBR6Q
 YW/7r8TAvJDgABWdu1RcpBFhGuZepYEBNToDtYAP/fLWJ14s0PqpJFM0JKZWUh4Q
 SsX6zKuUcER09QyvFRmRRtF6HlyL/X84Rkf6wUfNvdaUOEUNF4qotG/6281ZlHxF
 +RdKQkvx6Tv9oZAKyk9dwiYj6YtmGhZ4JQNoj+4yCqQ+ImLVlbfkLGMSPIzE1/KO
 3+crrYTFl+hFcy+66hFgMz7RvbH0k+6djBkg2PDV1aD2EklStP6V98Wpxwm+fYhz
 ka2Up5w+aDlp5Snif7+pH6oP0A1FvveTlv3t1wp3q9B2iqF7Ps4A+9J1L7p0n/4=
 =W4R5
 -----END PGP SIGNATURE-----

Merge tag 'at91-fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/nferre/linux-at91 into fixes

Fixes: second batch for 4.14:
- one DT phy address fix for the new sama5d27 som1 ek
- two DT ADC patches that were forgotten while moving to
  hardware triggers for sama5d2 (iio changes already applied)

* tag 'at91-fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/nferre/linux-at91:
  ARM: dts: at91: sama5d2: add ADC hw trigger edge type
  ARM: dts: at91: sama5d2_xplained: enable ADTRG pin
  ARM: dts: at91: at91-sama5d27_som1: fix PHY ID
2017-10-19 17:36:08 +02:00
Arnd Bergmann 4cb4261dc2 This pull request contains Broadcom ARM-based SoC Device Tree fixes for 4.14,
please pull the following:
 
 - Loic fixes the console path on the Raspberry Pi 3 which was not correctly set
   and would cause all sorts of confusion between the Bluetooth controller and the
   kernel console
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCAAGBQJZ2AFxAAoJEIfQlpxEBwcEFcsP/375LxHvuaw3Uo6HlrJ77+sF
 RM1E6DfDPkcfk9MQ+U3UUKWBk66HU76epVIX+8H/ERxB0Y7gShhHG7wX54YzsA5Z
 Wh/KiHC0HUGAhZWguOK88JSj9cO90k35tSp+JHktVbtI6lf2r14ZQeMgcnulFuHM
 rAbBmC+ap2ACOtGKg/Glj3205yqhllxUEBU3pu5kDZaRWTGqifJaa4DyKGGDx7KS
 YDqAYs3EB6i753CDwoztxtQj1gEVrFSmLEcbdrUnAPGFTv2IDy2faxjpfAdus6q4
 NMzSa0A4MRsEM/FaxYyF64y0SQyqeEFZ7Znj8bU7mEJrE0cpjPEXrRRqwCyceIv3
 4FjEIkd2x8b+drIm6yXaMAQuMSuIsWwO2RUGJnF8JG8XXMuUDL5bZpnn2RrsTmcb
 RjcOddgPgQusLJnRB86SkHWts8Bu/a8Q+gQQgfZsVXtpqZvyjEw3GPWnPoQEKmCI
 ZvDbIP7VQe+niCGMBu9jez+sNjOkvUz0SyWnPg/Va0lofKifp4ZZxlX9SwRFOQAy
 ii3b5O+WYCVNnWgGOBkSOHbqb6nnrpwgQk2CsdRuB86c/yzhv3/dpr+cXPSX0h+q
 4c5fNxfcJThgSL86lm/L/SZ1Fuc+MFbYaKcLJLMY1JZ7kxUcaKMqrRUojh9/AoiU
 89ksb1UE2vTclL8q1nyY
 =GeQi
 -----END PGP SIGNATURE-----

Merge tag 'arm-soc/for-4.14/devicetree-fixes' of http://github.com/Broadcom/stblinux into fixes

Pull "Broadcom devicetree fixes for 4.14" from Florian Fainelli:

This pull request contains Broadcom ARM-based SoC Device Tree fixes for 4.14,
please pull the following:

- Loic fixes the console path on the Raspberry Pi 3 which was not correctly set
  and would cause all sorts of confusion between the Bluetooth controller and the
  kernel console

* tag 'arm-soc/for-4.14/devicetree-fixes' of http://github.com/Broadcom/stblinux:
  ARM: dts: bcm283x: Fix console path on RPi3
2017-10-19 17:30:31 +02:00
Xin Long df80cd9b28 sctp: do not peel off an assoc from one netns to another one
Now when peeling off an association to the sock in another netns, all
transports in this assoc are not to be rehashed and keep use the old
key in hashtable.

As a transport uses sk->net as the hash key to insert into hashtable,
it would miss removing these transports from hashtable due to the new
netns when closing the sock and all transports are being freeed, then
later an use-after-free issue could be caused when looking up an asoc
and dereferencing those transports.

This is a very old issue since very beginning, ChunYu found it with
syzkaller fuzz testing with this series:

  socket$inet6_sctp()
  bind$inet6()
  sendto$inet6()
  unshare(0x40000000)
  getsockopt$inet_sctp6_SCTP_GET_ASSOC_ID_LIST()
  getsockopt$inet_sctp6_SCTP_SOCKOPT_PEELOFF()

This patch is to block this call when peeling one assoc off from one
netns to another one, so that the netns of all transport would not
go out-sync with the key in hashtable.

Note that this patch didn't fix it by rehashing transports, as it's
difficult to handle the situation when the tuple is already in use
in the new netns. Besides, no one would like to peel off one assoc
to another netns, considering ipaddrs, ifaces, etc. are usually
different.

Reported-by: ChunYu Wang <chunwang@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-19 13:16:07 +01:00
David S. Miller 4bbb508348 Merge branch 'bpf-Fix-for-BPF-devmap-percpu-allocation-splat'
Daniel Borkmann says:

====================
bpf: Fix for BPF devmap percpu allocation splat

The set fixes a splat in devmap percpu allocation when we alloc
the flush bitmap. Patch 1 is a prerequisite for the fix in patch 2,
patch 1 is rather small, so if this could be routed via -net, for
example, with Tejun's Ack that would be good. Patch 3 gets rid of
remaining PCPU_MIN_UNIT_SIZE checks, which are percpu allocator
internals and should not be used.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-19 13:14:11 +01:00
Daniel Borkmann bc6d5031b4 bpf: do not test for PCPU_MIN_UNIT_SIZE before percpu allocations
PCPU_MIN_UNIT_SIZE is an implementation detail of the percpu
allocator. Given we support __GFP_NOWARN now, lets just let
the allocation request fail naturally instead. The two call
sites from BPF mistakenly assumed __GFP_NOWARN would work, so
no changes needed to their actual __alloc_percpu_gfp() calls
which use the flag already.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-19 13:13:50 +01:00
Daniel Borkmann 82f8dd28bd bpf: fix splat for illegal devmap percpu allocation
It was reported that syzkaller was able to trigger a splat on
devmap percpu allocation due to illegal/unsupported allocation
request size passed to __alloc_percpu():

  [   70.094249] illegal size (32776) or align (8) for percpu allocation
  [   70.094256] ------------[ cut here ]------------
  [   70.094259] WARNING: CPU: 3 PID: 3451 at mm/percpu.c:1365 pcpu_alloc+0x96/0x630
  [...]
  [   70.094325] Call Trace:
  [   70.094328]  __alloc_percpu_gfp+0x12/0x20
  [   70.094330]  dev_map_alloc+0x134/0x1e0
  [   70.094331]  SyS_bpf+0x9bc/0x1610
  [   70.094333]  ? selinux_task_setrlimit+0x5a/0x60
  [   70.094334]  ? security_task_setrlimit+0x43/0x60
  [   70.094336]  entry_SYSCALL_64_fastpath+0x1a/0xa5

This was due to too large max_entries for the map such that we
surpassed the upper limit of PCPU_MIN_UNIT_SIZE. It's fine to
fail naturally here, so switch to __alloc_percpu_gfp() and pass
__GFP_NOWARN instead.

Fixes: 11393cc9b9 ("xdp: Add batching support to redirect map")
Reported-by: Mark Rutland <mark.rutland@arm.com>
Reported-by: Shankara Pailoor <sp3485@columbia.edu>
Reported-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: John Fastabend <john.fastabend@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-19 13:13:50 +01:00
Daniel Borkmann 0ea7eeec24 mm, percpu: add support for __GFP_NOWARN flag
Add an option for pcpu_alloc() to support __GFP_NOWARN flag.
Currently, we always throw a warning when size or alignment
is unsupported (and also dump stack on failed allocation
requests). The warning itself is harmless since we return
NULL anyway for any failed request, which callers are
required to handle anyway. However, it becomes harmful when
panic_on_warn is set.

The rationale for the WARN() in pcpu_alloc() is that it can
be tracked when larger than supported allocation requests are
made such that allocations limits can be tweaked if warranted.
This makes sense for in-kernel users, however, there are users
of pcpu allocator where allocation size is derived from user
space requests, e.g. when creating BPF maps. In these cases,
the requests should fail gracefully without throwing a splat.

The current work-around was to check allocation size against
the upper limit of PCPU_MIN_UNIT_SIZE from call-sites for
bailing out prior to a call to pcpu_alloc() in order to
avoid throwing the WARN(). This is bad in multiple ways since
PCPU_MIN_UNIT_SIZE is an implementation detail, and having
the checks on call-sites only complicates the code for no
good reason. Thus, lets fix it generically by supporting the
__GFP_NOWARN flag that users can then use with calling the
__alloc_percpu_gfp() helper instead.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Tejun Heo <tj@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-19 13:13:49 +01:00
David S. Miller 3fd3b03b43 Merge branch 'ena-fixes'
Netanel Belgazal says:

====================
ENA ethernet driver bug fixes

Some fixes for ENA ethernet driver
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-19 12:49:16 +01:00
Netanel Belgazal a59df39676 net: ena: fix wrong max Tx/Rx queues on ethtool
ethtool ena_get_channels() expose the max number of queues as the max
number of queues ENA supports (128 queues) and not the actual number
of created queues.

Signed-off-by: Netanel Belgazal <netanel@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-19 12:49:15 +01:00
Netanel Belgazal 411838e7b4 net: ena: fix rare kernel crash when bar memory remap fails
This failure is rare and only found on testing where deliberately fail
devm_ioremap()

[  451.170464] ena 0000:04:00.0: failed to remap regs bar
451.170549] Workqueue: pciehp-1 pciehp_power_thread
[  451.170551] task: ffff88085a5f2d00 task.stack: ffffc9000756c000
[  451.170552] RIP: 0010:devm_iounmap+0x2d/0x40
[  451.170553] RSP: 0018:ffffc9000756fac0 EFLAGS: 00010282
[  451.170554] RAX: 00000000fffffffe RBX: 0000000000000000 RCX:
0000000000000000
[  451.170555] RDX: ffffffff813a7e00 RSI: 0000000000000282 RDI:
0000000000000282
[  451.170556] RBP: ffffc9000756fac8 R08: 00000000fffffffe R09:
00000000000009b7
[  451.170557] R10: 0000000000000005 R11: 00000000000009b6 R12:
ffff880856c9d0a0
[  451.170558] R13: ffffc9000f5c90c0 R14: ffff880856c9d0a0 R15:
0000000000000028
[  451.170559] FS:  0000000000000000(0000) GS:ffff88085f400000(0000)
knlGS:0000000000000000
[  451.170560] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  451.170561] CR2: 00007f169038b000 CR3: 0000000001c09000 CR4:
00000000003406f0
[  451.170562] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[  451.170562] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7:
0000000000000400
[  451.170563] Call Trace:
[  451.170572]  ena_release_bars.isra.48+0x34/0x60 [ena]
[  451.170574]  ena_probe+0x144/0xd90 [ena]
[  451.170579]  ? ida_simple_get+0x98/0x100
[  451.170585]  ? kernfs_next_descendant_post+0x40/0x50
[  451.170591]  local_pci_probe+0x45/0xa0
[  451.170592]  pci_device_probe+0x157/0x180
[  451.170599]  driver_probe_device+0x2a8/0x460
[  451.170600]  __device_attach_driver+0x7e/0xe0
[  451.170602]  ? driver_allows_async_probing+0x30/0x30
[  451.170603]  bus_for_each_drv+0x68/0xb0
[  451.170605]  __device_attach+0xdd/0x160
[  451.170607]  device_attach+0x10/0x20
[  451.170610]  pci_bus_add_device+0x4f/0xa0
[  451.170611]  pci_bus_add_devices+0x39/0x70
[  451.170613]  pciehp_configure_device+0x96/0x120
[  451.170614]  pciehp_enable_slot+0x1b3/0x290
[  451.170616]  pciehp_power_thread+0x3b/0xb0
[  451.170622]  process_one_work+0x149/0x360
[  451.170623]  worker_thread+0x4d/0x3c0
[  451.170626]  kthread+0x109/0x140
[  451.170627]  ? rescuer_thread+0x380/0x380
[  451.170628]  ? kthread_park+0x60/0x60
[  451.170632]  ret_from_fork+0x25/0x30

Signed-off-by: Netanel Belgazal <netanel@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-19 12:49:15 +01:00
Netanel Belgazal cd7aea1875 net: ena: reduce the severity of some printouts
Decrease log level of checksum errors as these messages can be
triggered remotely by bad packets.

Signed-off-by: Netanel Belgazal <netanel@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-10-19 12:49:15 +01:00
Wolfgang Grandegger 97819f9430 can: gs_usb: fix busy loop if no more TX context is available
If sending messages with no cable connected, it quickly happens that
there is no more TX context available. Then "gs_can_start_xmit()"
returns with "NETDEV_TX_BUSY" and the upper layer does retry
immediately keeping the CPU busy. To fix that issue, I moved
"atomic_dec(&dev->active_tx_urbs)" from "gs_usb_xmit_callback()" to
the TX done handling in "gs_usb_receive_bulk_callback()". Renaming
"active_tx_urbs" to "active_tx_contexts" and moving it into
"gs_[alloc|free]_tx_context()" would also make sense.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-10-19 13:05:54 +02:00
Stefan Mätje 72d92e865d can: esd_usb2: Fix can_dlc value for received RTR, frames
The dlc member of the struct rx_msg contains also the ESD_RTR flag to
mark received RTR frames. Without the fix the can_dlc value for received
RTR frames would always be set to 8 by get_can_dlc() instead of the
received value.

Fixes: 96d8e90382 ("can: Add driver for esd CAN-USB/2 device")
Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-10-19 13:05:54 +02:00
Marc Kleine-Budde 5a606223c6 can: af_can: can_pernet_init(): add missing error handling for kzalloc returning NULL
This patch adds the missing check and error handling for out-of-memory
situations, when kzalloc cannot allocate memory.

Fixes: cb5635a367 ("can: complete initial namespace support")
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-10-19 13:05:54 +02:00
Marc Kleine-Budde cae1d5b78f can: af_can: do not access proto_tab directly use rcu_access_pointer instead
"proto_tab" is a RCU protected array, when directly accessing the array,
sparse throws these warnings:

  CHECK   /srv/work/frogger/socketcan/linux/net/can/af_can.c
net/can/af_can.c:115:14: error: incompatible types in comparison expression (different address spaces)
net/can/af_can.c:795:17: error: incompatible types in comparison expression (different address spaces)
net/can/af_can.c:816:9: error: incompatible types in comparison expression (different address spaces)

This patch fixes the problem by using rcu_access_pointer() and
annotating "proto_tab" array as __rcu.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-10-19 13:05:53 +02:00
Colin Ian King 62c04647c6 can: bcm: check for null sk before deferencing it via the call to sock_net
The assignment of net via call sock_net will dereference sk. This
is performed before a sanity null check on sk, so there could be
a potential null dereference on the sock_net call if sk is null.
Fix this by assigning net after the sk null check. Also replace
the sk == NULL with the more usual !sk idiom.

Detected by CoverityScan CID#1431862 ("Dereference before null check")

Fixes: 384317ef41 ("can: network namespace support for CAN_BCM protocol")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-10-19 13:05:53 +02:00
ZHU Yi (ST-FIR/ENG1-Zhu) fb5b91d61b can: flexcan: fix p1010 state transition issue
Enable FLEXCAN_QUIRK_BROKEN_WERR_STATE and
FLEXCAN_QUIRK_BROKEN_PERR_STATE for p1010 to report correct state
transitions.

Signed-off-by: Zhu Yi <yi.zhu5@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Cc: linux-stable <stable@vger.kernel.org> # >= v4.11
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-10-19 13:05:53 +02:00
ZHU Yi (ST-FIR/ENG1-Zhu) 083c557129 can: flexcan: fix i.MX28 state transition issue
Enable FLEXCAN_QUIRK_BROKEN_PERR_STATE for i.MX28 to report correct
state transitions, especially to error passive.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Zhu Yi <yi.zhu5@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Cc: linux-stable <stable@vger.kernel.org> # >= v4.11
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-10-19 13:05:53 +02:00
ZHU Yi (ST-FIR/ENG1-Zhu) cf9c04677f can: flexcan: fix i.MX6 state transition issue
Enable FLEXCAN_QUIRK_BROKEN_PERR_STATE for i.MX6 to report correct state
transitions.

Signed-off-by: Zhu Yi <yi.zhu5@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Cc: linux-stable <stable@vger.kernel.org> # >= v4.11
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-10-19 13:05:53 +02:00
ZHU Yi (ST-FIR/ENG1-Zhu) da49a8075c can: flexcan: implement error passive state quirk
Add FLEXCAN_QUIRK_BROKEN_PERR_STATE for better description of the
missing error passive interrupt quirk.

Error interrupt flooding may happen if the broken error state quirk fix
is enabled. For example, in case there is singled out node on the bus
and the node sends a frame, then error interrupt flooding happens and
will not stop because the node cannot go to bus off. The flooding will
stop after another node connected to the bus again.

If high bitrate configured on the low end system, then the flooding
may causes performance issue, hence, this patch mitigates this by:
1. disable error interrupt upon error passive state transition
2. re-enable error interrupt upon error warning state transition
3. disable/enable error interrupt upon error active state transition
   depends on FLEXCAN_QUIRK_BROKEN_WERR_STATE

In this way, the driver is still able to report correct state
transitions without additional latency. When there are bus problems,
flooding of error interrupts is limited to the number of frames required
to change state from error warning to error passive if the core has
[TR]WRN_INT connected (FLEXCAN_QUIRK_BROKEN_WERR_STATE is not enabled),
otherwise, the flooding is limited to the number of frames required to
change state from error active to error passive.

Signed-off-by: Zhu Yi <yi.zhu5@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Cc: linux-stable <stable@vger.kernel.org> # >= v4.11
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-10-19 13:05:53 +02:00
ZHU Yi (ST-FIR/ENG1-Zhu) 2f8639b24b can: flexcan: rename legacy error state quirk
Rename FLEXCAN_QUIRK_BROKEN_ERR_STATE to FLEXCAN_QUIRK_BROKEN_WERR_STATE
for better description of the missing [TR]WRN_INT quirk.

Signed-off-by: Zhu Yi <yi.zhu5@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Cc: linux-stable <stable@vger.kernel.org> # >= v4.11
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-10-19 13:05:53 +02:00
ZHU Yi (ST-FIR/ENG1-Zhu) ad2302345d can: flexcan: fix state transition regression
Update state upon any interrupt to report correct state transitions in
case the flexcan core enabled the broken error state quirk fix.

Signed-off-by: Zhu Yi <yi.zhu5@cn.bosch.com>
Signed-off-by: Mark Jonas <mark.jonas@de.bosch.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Cc: linux-stable <stable@vger.kernel.org> # >= v4.11
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2017-10-19 13:05:53 +02:00